Browsed by
Category: Linux

Graylog and AWS quick start

Graylog and AWS quick start

Today let’s examine Graylog – an open source log management tool. I am going to run an AWS EC2 instance based on a publicly available AMI. Current list of images is available here. It’s recommended to have at least 4GB memory for this appliance, so I have chosen t.2medium sized instance. It’s important to set correct security rules. I have created a special rule set for this test graylog server, allowing only the access from my IP. In a production…

Read More Read More

Java Timestamp vs Unix Timestamp

Java Timestamp vs Unix Timestamp

Unix timestamp is the number of seconds that have elapsed since midnight of January 1st 1970. To display unix timestamp in shell type: date +%s Sample output is a ten digit number: 1385726996   Java timestamp is the number of milliseconds that have elapsed since midnight of January 1st 1970 (thirteen digit number).

  To display unix timestamp in Java you can divide Java timestamp value by 1000:

  See also: Wikipedia – Year 2038 problem

Linux: Errors on FAT32 and NTFS partitions

Linux: Errors on FAT32 and NTFS partitions

Recently I have discovered interesting Linux feature (personally I am using Mint) – partitions with errors are mounted as read only. There are different ways of dealing with errors, depending of file system. FAT32 Install dosfscktools:

To use Dosfsck, you have to indicate the device address you want (Ex. /dev/sdb1, /dev/sdb2, or other device.). To know your device address, open the terminal (CTRL+ALT+T), then run this command:

If your partition is /dev/sdb1, for example, then unmount it first…

Read More Read More

which vs whereis vs locate vs find

which vs whereis vs locate vs find

There multiple search commands in linux and it is good to know when use of particular command is relevant. which Shows the full path of (shell) commands. For example:

  whereis Locate the binary, source, and manual page files for a command.

  locate Find files by name. For example let’s locate where is my system storing backup of /etc/passwd:

  find Search for files in a directory hierarchy. Let’s find all files in my home directory…

Read More Read More

Linux: FTP server setup

Linux: FTP server setup

Sometimes we might need to setup an FTP server (for example for our client/co-worker to upload some large files). It is quick and easy. 1. Login as a root (su – root under Debian, sudo su – root under Ubuntu etc. ). Type: apt-get install proftpd  or  yum install proftpd  (under Fedora/CentOS) 2. Edit file /etc/shells (I use nano) and add /bin/false nano /etc/shells 3. Add user ftp.

4. Make home dir for ftp user and set premissions.

5. Optional: create  download & upload dir under…

Read More Read More