Thanks to antville.org
Curling PHP

CURL can be used very effectively using PHP. Here is an example.

cat curl.php

<?php
$ch = curl_init("www.google.com");
$fp = fopen("example.txt", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

... Link (0 comments) ... Comment


Counting file types

cat myawk.sh

!/bin/sh

list the type of files with count

find ${*-.} -type f -print | xargs file |
awk '{
$1=NULL;
t[$0]++;
}
END {
for (i in t) printf("%d\t%s\n", t[i], i);
}' | sort -nr

... Link (0 comments) ... Comment


Easy SSH

HashKnownHosts no
Add the above line in your ssh_config file that can be found here....
/etc/ssh/ssh_config

... Link (0 comments) ... Comment


Old date in Shell

If you need to know the 3 days old date, it easy in shell.

$ v_prev_date=date --date='3 days ago' +%Y%m%d

$ echo $v_prev_date
20090808

... Link (0 comments) ... Comment


Number all lines in a file

perl -pe '$ = "$. $"'

“-p” causes Perl to assume a loop around the program (specified by “-e”) that reads each line of input into the ” $ ” variable, executes the program and then prints the ” $ ” variable. In this one-liner I simply modify ” $_ ” and prepend the ” $. ” variable to it. The special variable ” $. ” contains the current line number of input.
The result is that each line gets its line number prepended.

... Link (0 comments) ... Comment


awk power

$ cat salaries
Yvette van der Hoff 100000
Sarack Abama 400000
Bernie Madoff 0
John Q. Public 20000

$ awk '{print $NF, $0}' salaries | sort -nr -k1,1 | cut -d" " -f2-
Sarack Abama 400000
Yvette van der Hoff 100000
John Q. Public 20000
Bernie Madoff 0

$ awk -F '\t' -v 'OFS=\t' '{print $4, $3, $5, $2, $1}' data.txt
POP. COUNTY GOVT. CITY STATE
123 Gila Mayor Ely AZ
345 Lolo Sheriff Alma CA
22 El Paso Bubba Leroy TX

... Link (0 comments) ... Comment


setting at jobs

at -v 03:00 -f /root/shantanu/testat.sh > /root/shantanu/testat_result.txt 2>&1

atq

7 2009-03-14 03:00 a root

... Link (0 comments) ... Comment


common crontab entry

30 0 * updatedb > /dev/null 2>&1

Clock synchronization

30 10 CTIPDGT=`/sbin/ifconfig | grep -m 1 "inet addr" | grep -o "17.2.[0,8,26,32,40,56,16,40,56]." | cut -d "." -f3`; /usr/sbin/ntpdate -u 172.29.${CTIPDGT}.123; /sbin/hwclock --systohc > /dev/null 2>&1

... Link (0 comments) ... Comment


Declare your assets!

The declare command can be helpful in identifying variables, environmental or otherwise. This can be especially useful with arrays.

bash$ declare | grep HOME
/home/bozo

bash$ zzy=68
bash$ declare | grep zzy
zzy=68

bash$ Colors=([0]="purple" [1]="reddish-orange" [2]="light green")
bash$ echo ${Colors[@]}
purple reddish-orange light green
bash$ declare | grep Colors
Colors=([0]="purple" [1]="reddish-orange" [2]="light green")

... Link (0 comments) ... Comment


Online for 6367 days
Last modified: 1/29/20 11:15 AM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
January 2020
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031
December
Recent updates
LibreOffice version conflict I am
not able to install latest version of Libre office. I...
by shantanuo (1/29/20 11:15 AM)
Amazing! Yeahh! you have an
informative blog so far. Thanks for sharing | roof repair...
by Danielperez123 (1/28/20 8:32 PM)
Great Work Thanks for sharing
the post. Microsoft toolkit
by talisasoto1989 (1/27/20 10:22 PM)
Farnham Carpet Cleaning Thanks Farnham
Carpet Cleaning
by Dubs@gl.com (1/27/20 10:13 PM)
Locksmith Guildford That's an interesting
point Locksmith in Guildford
by Dubs@gl.com (1/27/20 10:11 PM)
while loop This is
a sample shell script while loop while read mydb do echo...
by shantanuo (1/26/20 2:24 PM)
compare mysql schema And here
is poor man's schema compare using good old diff command......
by shantanuo (1/26/20 1:49 PM)
Selecting from error log grep
"error" error_log |awk -F[ {'print $4'} \ | sort |...
by shantanuo (1/26/20 12:40 PM)
Rank mysql records using variables
SET @rank = 0, @prev_val = NULL; SELECT rank, correct...
by shantanuo (1/26/20 11:45 AM)
Thanks for sharing this!!
commercial roofing huntsville al
by Mazikeen (1/24/20 6:37 PM)
Sophie Chciałbym więcej o tym
przeczytać. Szybka, jaka literatura ma studiować? texas colleges and universities
by panistefanin (1/24/20 3:45 PM)
Jack Lovely information thank you
very much decanters
by decanter2020 (1/24/20 1:20 PM)
I like it I like
that logic. interior painting
by LisaCook (1/23/20 10:11 PM)
Love it I like this!
Thanks for posting roll off canister
by LaurenHill (1/23/20 10:05 PM)
Thanks for the heads up!
Thank you for sharing this. Our website
by mozaic (1/23/20 2:32 PM)
Thank you for sharing
a really great piece of information. bubble shooter
by longjumper (1/21/20 11:05 AM)
Thanks Thanks for sharing these.
Sam H - Interior Painter Scaumburg Il
by Samh2019 (1/21/20 10:14 AM)
Fencing in Guildford thanks for
the information Fencing in Guildford Fencing in Surrey
by Dubs (1/20/20 9:26 PM)
satta matka matka boss satta
matka Visit our site for more information
by sattamatka3.net (1/20/20 7:52 PM)
Beebeetravvel Thanks for sharing your
valuable information. we are a tour & travel agency with...
by coolexusa (1/20/20 2:27 PM)
Access Control System Dubai Fingerprintdubai
Company is providing many types of Services like , card...
by coolexusa (1/20/20 12:19 PM)
Air Duct Cleaning This type
of Duct cleaning Miami is absolutely not a must have...
by coolexusa (1/20/20 11:26 AM)
Carpet Cleaning Oxford and Surrounding
Areas Interesting read. Carpet cleaning in Oxford and surrounding areas
by Murray Whelehan (1/19/20 8:18 PM)
Antares AutoTune Crack License
Key With Keygen ( MAC ) A Antares AutoTune Pro Crack...
by ijicrackgh (1/19/20 9:50 AM)
Waves Tune Real-Time Crack (Latest)
Free Download 2020! Visit my site and free crack full...
by ijicrackgh (1/19/20 9:45 AM)

RSS feed

Made with Antville
Helma Object Publisher