How to Check Inode Usage in Linux

When a file or a directory is created in a Linux file system, a name and a uniq inode number is assigned to it.

An inode is a data structure that contains information about a disk block location of a file or a directory and may include metadata (times of last change, access, modification), as well as information about the owner and permissions.

The number of inodes is defined during the file system creation and can’t be increased without reformatting the partition.

In this note i will show how to check the inode usage in Linux, how to list top directories sorted by inode usage and how to show the inode number of a file or a directory. (more…)

Windows: ARP Command – Show Table & Clear Cache

An ARP (Address Resolution Protocol) is a communication protocol that works on a “Physical (Data-Link)” layer of a TCP/IP stack and is used to discover a MAC address of a device on a LAN (local-area network) based on its IP address.

An ARP table is used to store the discovered pairs of the MAC and IP addresses.

In this note i will show how to display the ARP table and how to clear the ARP cache using the Windows arp command. (more…)

Arduino: Random Numbers & Delay – RandomSeed

A randomSeed(analogRead(0)) in Arduino initializes the pseudo-random number generator that reads the random analog noise from an unconnected analog pin 0 and floats to relatively random values between 0 and 1023.

This shuffles the random() number generator each time you start the Arduino sketch.

In this note i will show the examples of how to generate random numbers and create random delays in Arduino using the randomSeed() and random() functions. (more…)

Arduino: Key Press Simulation (Without Button)

A USB Keyboard function in Arduino can be used to send keystrokes to an attached computer.

Unfortunately this capability is limited to Arduino boards with the ATmega32u4 microchip i.e. Arduino Leonardo, Arduino Micro and Arduino-compatible Pro Micro (though the last one is really cheap).

Below you will find some code snippets with the examples of how to simulate keystrokes, including a multiple key pressing, using the Arduino boards.

To make it more simple, the keystrokes in the examples below will be called in a loop, so there is no need to install any additional hardware buttons. (more…)

.htaccess – Deny IP & Block IP Range

The .htaccess file is a configuration file for the Apache web server, that can be used to restrict access to a web-site from a specific IP or a range of IP addresses.

In this note i will show how to deny access from one or several IP addresses via .htaccess file and how to block access from a range of IP addresses or from entire subnets. (more…)