Solutionist's Blog

Tech | Health | Life | Travel

Find files between two dates

To print all the files from 19-10-2007 to 21-11-2007 $ find . -type f -exec ls -l –time-style=full-iso {} \; | awk ‘{print $6,$NF}’ | awk ‘{gsub(/-/,””,$1);print}’ | awk ‘$1>= 20071019 && $1<= 20071121 {print $2}’   and you can combined it with CP to find and copy files

squid: block particular file extension .mp3 block

First open squid.conf file /etc/squid/squid.conf: # vi /etc/squid/squid.conf Now add following lines to your squid ACL section: acl blockfiles urlpath_regex “/etc/squid/multimedia.files.acl” Now create the the file # vi /etc/squid/multimedia.files.acl \.[Ee][Xx][Ee]$ \.[Aa][Vv][Ii]$ \.[Mm][Pp][Gg]$ \.[Mm][Pp][Ee][Gg]$ \.[Mm][Pp]3$ Save and close the file and Restart Squid: # /etc/init.d/squid restart Courtesy: http://linuxpoison.blogspot.tw/2007/10/block-mp3-mpg-mpeg-exe-files-using.html   but Cybercity blog goes one step further […]

linux-unix-find-inode-of-a-file-command

The inode (index node) is a fundamental concept in the Linux and UNIX filesystem. Each object in the filesystem is represented by an inode. But what are the objects? Let us try to understand it in simple words. Each and every file under Linux (and UNIX) has following attributes: => File type (executable, block special etc) => […]

Install SNMP Centos / RHEL

nstalling SNMP daemon and tools: As root yum -y install net-snmp.i686 yum -y install net-snmp-utils Once these are installed start the snmp daemon: /etc/init.d/snmpd start chkconfig snmpd on   This is just the basic install but testing it : snmpwalk -v 1 -c public -O e 127.0.0.1 For production servers it is advisable to at least […]

how-do-i-find-out-what-shell-im-using

ps -p $$ So what is $ argument passed to -p option? Remember $ returns the PID (process identification number) of the current process, and the current process is your shell. So running a ps on that number displays a process status listing of your shell. In that listing you will find the name of […]

mdadm raid array lost after reboot

mdadm is a pain, since it doesn’t record the raid settings automatically, after you set everything up, you have to remember to save the mdadm.conf file. What a pain. Anyway, I forgot to do that, and on reboot, it hung my machine saying /dev/md0 was hosed. So here is how I recovered it. originally, my […]

convert-epoch-to-human-readable-date-and-vice-versa

What is epoch time? The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970), but ‘epoch’ is often used as a synonym for ‘Unix time’. Many Unix systems […]

Secured By miniOrange