Linux

Restrict daemon access using TCP Wrapper

TCP Wrapper is a host-based Networking ACL system, used to filter network access to Internet Protocol servers on (Unix-like) operating systems such as Linux or BSD. It allows host or subnetwork IP addresses, names and/or ident query replies, to be used as tokens on which to filter for access control purposes.

Read More
Windows

Formatting date in MS-DOS batch file

I needed to make a simple MS-DOS backupscript in Windows XP today and the files were supposed to be stored in folders named by the current date, ISO style. I ended up formatting the date using the following command echo %date:~6,8%-%date:~3,2%-%date:~0,2% Output 2007-10-02 The script @echo off REM Declare variables Set TODAYSDATE=%date:~6,8%-%date:~3,2%-%date:~0,2% Set DATADRIVE=c: Set […]

Read More
Linux

Script to backup MySql database

#!/bin/bash # Shell script to backup MySql database # To backup Nysql databases file to /backup dir and later pick up by your # script. You can skip few databases from backup too. MyUSER=”SET-MYSQL-USER-NAME” # USERNAME MyPASS=”SET-PASSWORD” # PASSWORD MyHOST=”localhost” # Hostname # Linux bin paths, change this if it can’t be autodetected via which […]

Read More
Linux

Find domain expiration date

To get expiration date use grep command: $ whois nixcraft.com | egrep -i ‘Expiration|Expires on’ Output: Expiration Date: 10-may-2009 NOTICE: The expiration date displayed in this record is the date the currently set to expire. This date does not necessarily reflect the expiration view the registrar’s reported date of expiration for this registration. Expires on: […]

Read More