Skip to content

Instantly share code, notes, and snippets.

@Holzhaus
Holzhaus / dcparser.py
Last active November 18, 2020 01:01
Simple python Dreamcast image parser
#!/usr/bin/env python
# (c) 2015 Jan Holthuis
# A simple python script to get some info about Dreamcast images
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@rpavlik
rpavlik / VM-XServer-Instructions.md
Last active May 18, 2019 21:34
Cygwin X for a virtual machine

Using Cygwin X as a display for a Linux VM without SSH overhead

This is primarily for my own record and knowledge. If it helps you, great! If it breaks something, don't say I didn't warn you - this is just documentation of what I did to get this to work at the time I wrote this on one particular machine.

Environment

  • I have a 64-bit cygwin install in c:\cygwin64 (possible in 32-bit too, I just messed up that install and it no longer works, so these were tested on my machine in a 64-bit install). I use my Cygwin setup scripts to simplify this part.
  • I'm using VirtualBox on Windows 8.1.
    • Importantly (at least for VirtualBox), I added a "host-only networking" adapter for communication between the guest (VM) and host machine - this seems to be required.
  • Totally optional but useful part of my setup: I'm using VBoxHeadlessTray to be able to easily have my virtual machine running without taking
@bouchard
bouchard / download.rb
Created December 31, 2014 23:51
Download Private but Embedded Vimeo Videos
#!/usr/bin/env ruby
require 'nokogiri'
require 'net/http'
require 'shellwords'
require 'json'
source = Net::HTTP.get('www.domain.com', '/thepagethathasthevideos/')
doc = Nokogiri::HTML(source)
ids = doc.css('a').map{ |a| a.attr('data-vimeoid') }.compact.uniq
@deese
deese / SublimeTextContextMenu_User.cmd
Last active September 23, 2022 08:19
Add Sublimetext context menu for current user only
@echo off
SET st4Path=%~dp0sublime_text.exe
rem add it for all file types
@reg add "HKEY_CURRENT_USER\Software\Classes\*\shell\Open with Sublime Text 4" /t REG_SZ /v "" /d "Open with Sublime Text 4" /f
@reg add "HKEY_CURRENT_USER\Software\Classes\*\shell\Open with Sublime Text 4" /t REG_EXPAND_SZ /v "Icon" /d "%st4Path%,0" /f
@reg add "HKEY_CURRENT_USER\Software\Classes\*\shell\Open with Sublime Text 4\command" /t REG_SZ /v "" /d "%st4Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with Sublime Text 4" /t REG_SZ /v "" /d "Open with Sublime Text 4" /f
@rchaganti
rchaganti / Get-PythonMSI.ps1
Last active August 29, 2015 14:01
Download latest Python MSI from python.org/downloads
Function Test-Url {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[String] $Url,
[Parameter()]
[Switch] $ReturnUri
)
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active December 5, 2025 18:04
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

require 'rubygems'
require 'openssl'
require 'digest/md5'
key = OpenSSL::PKey::RSA.new(2048)
cipher = OpenSSL::Cipher::AES.new(256, :CBC)
ctx = OpenSSL::SSL::SSLContext.new
puts "Spoof must be in DER format and saved as root.cer"
raw = File.read "root.cer"
cert = OpenSSL::X509::Certificate.new raw
cert.version = 2
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active December 8, 2025 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@aras-p
aras-p / preprocessor_fun.h
Last active December 5, 2025 05:33
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@JosefJezek
JosefJezek / ldap2csv.py
Last active April 23, 2022 07:49
Export Users from Active Directory / LDAP to CSV file with Python
#!/usr/bin/python
# http://www.packtpub.com/article/python-ldap-applications-ldap-opearations
# sudo apt-get install python-ldap
import ldap
host = 'ldap://example.com:389'
dn = 'ldap@example.com'