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
# | |
# 1. global variable | |
# | |
my $num = 2; | |
exp(); | |
sub exp { | |
return $num * $num; | |
} |
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
"" filetype | |
filetype plugin on | |
set ofu=syntaxcomplete#Complete " omni completion | |
syntax enable | |
"" indenting | |
set tabstop=2 | |
set shiftwidth=2 | |
"set expandtab " spaces instead of tab | |
set autoindent | |
"" statusline |
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
def sum(a, b): | |
sum = a + b | |
return("the sum is", sum) |
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/env python | |
file = "/etc/passwd" | |
file_object = open(file, 'r') | |
shell = {} | |
for line in file_object: | |
line = line.strip() | |
fields = line.split(":") | |
shell[fields[0]] = fields[-1] |
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 | |
# Leave out comments and highlight regex | |
# Usage: $ mygrep [regex] <file> | |
# to compress blank lines: $ mygrep [regex] <file> | perl -00pe0 | |
use strict; | |
use warnings; | |
use Term::ANSIColor; | |
my $regex = shift unless -f $ARGV[0]; |
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 | |
# Change mtime of files so they sort on TV. | |
use strict; | |
use warnings; | |
use 5.010; | |
use File::Find; | |
die "Usage: $0 <dir(s)>\n" unless @ARGV; | |
my @files; |
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 | |
# Which companies are the names associated with? | |
use strict; | |
use warnings; | |
use HTML::LinkExtor; | |
use LWP::Simple; | |
use URI::Encode qw(uri_encode); | |
my $names_file = shift; |
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 | |
# Filter out records by column and regular expression | |
use strict; | |
use warnings; | |
use 5.010; | |
use Text::CSV_XS; | |
my $file = shift; | |
my $separator = shift // ';'; |
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
'1' OR '1' = '1' | |
1'%20or%20'1'%20=%20'1 | |
---- | |
UserName='1'%20or%20'1'%20=%20'1' | |
Password=1%27+or+%271%27+%3D+%271 | |
==> Incorrect syntax near '1'. | |
---- | |
1%27+or+%271%27+%3D+%271 | |
1%27+or+%271%27+%3D+%271 | |
==> Chybné heslo! |
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 Net::LDAP; | |
my $ldap = Net::LDAP->new("dom0.dyndns.org") or die $@; | |
$ldap->bind(); | |
my $base_dn = "dc=dom0,dc=dyndns,dc=org"; |
OlderNewer