This file contains hidden or 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 | |
#idea from: https://rossta.net/blog/pascals-triangle-with-rubys-enumerator.html | |
row=[1] | |
print row | |
for i in xrange(10): | |
row=[ sum(x) for x in zip([0]+row, row+[0]) ] | |
print row |
This file contains hidden or 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
#!/bin/bash | |
for f in * | |
do | |
n=$(echo $f|iconv -f LATIN1 -t UTF8 -c) | |
mv "$f" "$n" | |
done |
This file contains hidden or 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
public class LoopExample{ | |
public static void main(String[] args){ | |
/* sine */ | |
for(double y=1.0;y>=-1.0;y-=0.1){ | |
for(double x=0;x<=2*Math.PI;x+=5*Math.PI/180){ | |
if( (Math.sin(x)>=0 && y<=Math.sin(x) && y>=0) || | |
(Math.sin(x)<=0 && Math.sin(x)<=y && y<=0)) | |
System.out.print('*'); | |
else | |
System.out.print(' '); |
This file contains hidden or 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
#!/bin/bash | |
#In the file, list of usernames & passwords in format of: "user:pass" | |
file=credentiallist.txt | |
[[ $# -ne 1 ]] && echo "usage: $0 ip_or_hostname_here" && exit | |
while IFS=: read user pass | |
do | |
mysql -h $1 -u $user -p"$pass" -e STATUS && echo "Found: user=$user pass=$pass" && exit 0 | |
done < $file |
This file contains hidden or 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 ruby | |
# | |
# check all certificates in "./certs/" whether they are a self-signed certificate, or not. | |
# | |
require 'openssl' | |
Dir['certs/*'].each do |file| | |
#diff = `openssl x509 -in #{file} -noout -issuer -subject| cut -d'=' -f2 | uniq | wc -l` | |
#if diff.chomp == '1' | |
cert = OpenSSL::X509::Certificate.new(File.open(file)) |
This file contains hidden or 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 ruby | |
list=`iconv -l`.gsub(/[ \n]/,'').split('//') | |
list.each do |encode| | |
out = `iconv input.txt -f #{encode} -c -t UTF-8` | |
puts "#{encode}\t#{out}" | |
end |
This file contains hidden or 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
Original: http://seclists.org/fulldisclosure/2015/Jun/108 | |
Modified by: ptantiku | |
------------------------------------------------------------------------------------ | |
content.html | |
------------------------------------------------------------------------------------ | |
<html> | |
<body> | |
This is not facebook.com! This is EVIL! | |
<script> |
This file contains hidden or 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
# flush all iptables | |
iptables -F | |
iptables -t nat -F | |
# enable port forwarding | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
# set NAT: intranet --> eth1 --> MITM --> eth0 --> internet | |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
iptables -A FORWARD -i eth1 -j ACCEPT |
This file contains hidden or 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 python3 | |
# binary tree in array | |
# | |
# author: ptantiku | |
# | |
class Node: | |
id = 0 | |
data = "" |
This file contains hidden or 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
.data [5/1908] | |
hellostr: | |
.string "Hello World" | |
.text | |
.global main | |
main: | |
pushq %rbp | |
movq %rsp, %rbp |