Get the Plain Text Version of a Web Page
This command fetches a web page, converts it to text and shows it.
lynx -dump http://www.example.com/
This command fetches a web page, converts it to text and shows it.
lynx -dump http://www.example.com/
Want to show something on your machine to someone over the web? Don’t copy it or upload it somewhere. Just run “webshare” and the current directory and everything beneath it will be served from a new web server listening on port 8000. When your pal is finished, hit control-c.
python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"
For a slightly more advanced version of this server, see this article(Warning: German Article - but code is self explaining)
Just a joke - no offense intended…
perl -e '$a="etbjxntqrdke";$a=~s/(.)/chr(ord($1)+1)/eg;print $a'
This shell script will create a build of a firefox extension in linux. This is created according to my details(eg, the guid has @binnyva.com in it) - but you can modify it and use it yourself.
app=$1
folder=$2
if [ $# -eq 0 ] ; then
echo "Useage: sh build.sh []"
elif [ $# -eq 1 ] ; then
folder="$1@binnyva.com/"
fi
rm $app.xpi
cp -r $folder temp
cd temp
rm -rf .git
zip -r $app.xpi .>/dev/null
mv $app.xpi ..
cd ..
rm -rf temp
echo "Built $app successfully"
Use this code to force a download of any type of content with PHP
header("Content-type:application/octect-stream");
header('Content-Disposition: attachment; filename=filename_' . date('Y-m-d') . '.sql');
print "Hello World";
Creating a tag in SVN means that you copy the entire trunk to another folder in the ‘tags’ folder…
svn copy trunk/ tags/TAG_NAME
If you are getting a ‘Can’t locate CPAN.pm in @INC’ error while opening cpan, you have not installed Bundle::Cpan. You can do that without Cpan - using yum
yum install perl-CPAN
Remove comments and blank lines from example.pl
sed '/ *#/d; /^$/d' example.pl
The commands needed to merge two branches in git.
git checkout master
git merge BrachName
git commit -m "Merged" -a
A perl script to stop crond if mysqld is down
#!/usr/bin/perl
# See if MySQL server is alive or not
$mysql_status = `/etc/init.d/mysqld status`;
print "MySQL Status: $mysql_status\n";
unless($mysql_status =~ /running/) {
print "Stopping Cron... ";
#If MySQL is not running, kill the crond
$cron = `/etc/init.d/crond stop`;
print $cron;
}
print "\n";