This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; use warnings; | |
use XML::Twig; | |
my $t= XML::Twig->new( twig_handlers => | |
{ | |
'level(2)' => \&filter_doc | |
}, | |
pretty_print => 'indented', | |
output_filter => 'safe' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://gist.github.com/2118 | |
Unicode handling in Perl. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.DataOutputStream; | |
public class PackTest { | |
public static void main (String[] args) throws Exception { | |
DataOutputStream out = new DataOutputStream(System.out); | |
out.writeInt(11351); | |
out.flush(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://gist.github.com/2125 | |
Examples of database handling in Perl. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setting up auxiliary swap in linux | |
dd if=/dev/zero of=/auxswap bs=1M count=2048 | |
mkswap /auxswap | |
swapon /auxswap | |
# trun it on: | |
swapon -s | |
# turn it off: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sshd config tips | |
# add these lines at the end of /etc/ssh/sshd_config | |
# don't try reverse-dns lookup on connecting clients (this speeds up the initial connection establishment a lot): | |
UseDNS no | |
# make sure the client does not get disconnect due to being idle (ping every 5 mins): | |
ClientAliveInterval 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## setup | |
git config user.name "Siddhartha Reddy" | |
git config user.email "" | |
## setup -- global | |
git config --global user.name "Siddhartha Reddy" | |
git config --global user.email "" | |
git config --global color.branch "auto" | |
git config --global color.status "auto" | |
git config --global color.diff "auto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Recipe: Tomato Pappu | |
^^^^^^^^^^^^^^^^^^^^ | |
Ingredients | |
=========== | |
Toor Dal : 1 measure | |
Tomatoes : 4-5 measures | |
Turmeric Powder : a pinch | |
Oil : 1 tea spoon / measure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; use warnings; | |
use URI::Escape; | |
# http://www.perlhowto.com/encode_and_decode_url_strings | |
my $string = "Hello world!"; | |
my $encode = uri_escape($string); | |
print "Original string: $string\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Forcing a particular domain ### | |
RewriteCond %{HTTP_HOST} !^www.sids.in$ [NC] | |
RewriteRule ^(.*)$ http://www.sids.in$1 [R=301,L] |
OlderNewer