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 6268 days
Last modified: 10/22/19 2:54 AM
Status
Youre not logged in ... Login
Menu
... Home
... Tags

Search
Calendar
October 2019
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031
September
Recent updates
This is nice. At least
I've found a nice blog like this... Worth reading....
by casseverhart13 (10/22/19 2:54 AM)
check out the new
stuff you post in the future! magician Philadelphia
by casseverhart13 (10/21/19 5:03 AM)
Hope to read another
kind of article like this. pressure washing Gainesville
by casseverhart13 (10/18/19 4:35 AM)
Real Human Website Traffic -
The short answer is that it is #traffic that...
by webvisitors (10/17/19 10:01 PM)
Great! Thanks for sharing your
post, it seems really interesting to read. I hope to...
by Anna0203 (10/17/19 7:32 PM)
Great Thanks for posting this
one. :) commercial window cleaning cincinnati ohio
by brielleluna (10/17/19 7:27 PM)
Nice Since then, I always
check your article because it was really an informative one....
by Meggy27 (10/17/19 3:52 PM)
I hope you continue
writing about this kind of entry. carpet steam cleaner
by casseverhart13 (10/17/19 10:15 AM)
It's my pleasure to find
this amazing website who provides mostly unseen information about...
by casseverhart13 (10/17/19 5:26 AM)
Did you know that many
company Buy Website Traffic that is driven to their...
by webvisitors (10/17/19 2:28 AM)
USA State Targeted Traffic you
can isolate marketing efforts with a specific state, or...
by webvisitors (10/17/19 1:20 AM)
Want to work with a
reputable company with countless return customers? Talk to us...
by webvisitors (10/17/19 1:19 AM)
Weekly Email Notification enable Weekly
Email Notification from the Trusted Advisor. 1) Open the AWS...
by shantanuo (10/16/19 3:14 PM)
If most of your customers
are from Texas, don't waste time and money marketing...
by webvisitors (10/15/19 5:52 PM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 5:47 PM)
I hope you continue
writing about this kind of entry. Tree Solutions Hunter's Creek
by casseverhart13 (10/15/19 11:19 AM)
Great blog you have here
but I was wondering if you knew of any...
by casseverhart13 (10/15/19 5:17 AM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 12:43 AM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 12:42 AM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 12:42 AM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 12:42 AM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 12:41 AM)
Buy Website Traffic - Expand
your reach! Give prospects nationwide exposure to your products...
by webvisitors (10/15/19 12:41 AM)
Targeted Web Traffic If you
want the best, come to the best! Based in the...
by webvisitors (10/15/19 12:31 AM)
Prevol Financiera However, this method
of cashless electronic payment transaction has strings attached in terms...
by saeedkhatri (10/14/19 8:33 AM)

RSS feed

Made with Antville
Helma Object Publisher