Skip to content

Instantly share code, notes, and snippets.

View evandrix's full-sized avatar
💭
offline

evandrix evandrix

💭
offline
View GitHub Profile
@evandrix
evandrix / .bash_profile
Created July 11, 2011 00:12
A better ls for Mac OS X
# MacPorts
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
# Terminal colours (after installing GNU coreutils)
NM="\[\033[0;38m\]" #means no background and white lines
HI="\[\033[0;37m\]" #change this for letter colors
HII="\[\033[0;31m\]" #change this for letter colors
SI="\[\033[0;33m\]" #this is for the current directory
IN="\[\033[0m\]"
@evandrix
evandrix / favourites.sh
Created July 15, 2011 12:16
Commandlinefu.com
# http://www.commandlinefu.com/commands/favourites/plaintext
# commandlinefu.com by David Winterbottom
# Repoint an existing symlink to a new location
ln -nsf <TARGET> <LINK>
# RDP through SSH tunnel
ssh -f -L3389:<RDP_HOST>:3389 <SSH_PROXY> "sleep 10" && rdesktop -T'<WINDOW_TITLE>' -uAdministrator -g800x600 -a8 -rsound:off -rclipboard:PRIMARYCLIPBOARD -5 localhost
# Control ssh connection
@evandrix
evandrix / ansi_terminal_color.sh
Created June 29, 2011 11:59
CodeSnippets: ANSI terminal color chart
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
# Author: Giles Orr

Keybase proof

I hereby claim:

  • I am evandrix on github.
  • I am evandrix (https://keybase.io/evandrix) on keybase.
  • I have a public key ASBktS2U6T_UsjtfZ1SJQxJ2VZpY0pEXV1YyzrQCpSpByAo

To claim this, I am signing this object:

@evandrix
evandrix / gist:1076041
Created July 11, 2011 15:03
Using bcrypt to secure passwords in a Perl application
#!/usr/bin/perl
use Crypt::Eksblowfish::Bcrypt;
use Crypt::Random;
$password = 'bigtest';
$encrypted = encrypt_password($password);
print "$password is encrypted as $encrypted\n";
print "Yes the password is $password\n" if check_password($password, $encrypted);
print "No the password is not smalltest\n" if !check_password('smalltest', $encrypted);
@evandrix
evandrix / gist:1054070
Created June 29, 2011 15:20
Balsamiq Mockups v2.0.14
License Information:
Product: MockupsAir
Company: evandrix@gmail.com
Users : 9999
Serial : eJzzzU/OLi0odswsqkktS8xLKcqscEjPTczM0UvOz60xNrM0MDMzMzA0q3GusQQCAKviE
Dk=
*filter
# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow all outbound traffic - you can modify this to only allow certain traffic
@evandrix
evandrix / README
Created August 28, 2012 02:46
Hax.Tor
Level 1. Make a nasa.gov URL display a text of My Choice
Level 2. debfKNH1AvtBo deGH9Aq./kiSY denjFRfA8kzL2
Level 3. Recognize
Level 4. IP address is 72.14.221.104. What contains artvЂ â € ™ That Points to IT?
Level 5. Password is the owlvЂ ™ s Name
Level 6. LetvЂ ™ s See you do some Easy SQL ninjitsu
Level 7. snifflog.txt â € "ngrep format
Level 8. Password is on a Picture: not available from Anywhere
Level 9. Elementary Maths
Level 10. A poem
import math
for i in xrange(1,600001):
x=int('{0:b}'.format(i))
# x*=2
n=2**x
# print str(i)+":"+str(int(math.log(n,2)))+":"+str(((2**x)**2)%1000000007)+"/"+str(x),
print i,x
if i == 20: break
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HTML5 Video Player</title>
<link href="http://vjs.zencdn.net/4.1/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.1/video.js"></script>
</head>
<body style="padding-top:16px">
<style>