Skip to content

Instantly share code, notes, and snippets.

View localhost's full-sized avatar
👾
Where's the mystery ship?

::1 localhost

👾
Where's the mystery ship?
View GitHub Profile
@localhost
localhost / cw.sh
Created October 17, 2021 11:19
Center and optionally resize a window (X11)
#!/usr/bin/env bash
# uses wmctrl and xdotool
#
# improved upon the solutions listed in
# https://askubuntu.com/questions/104155/center-a-window-via-command-line
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage: $0 \"window name\" [ WxH ]"
exit 0
@localhost
localhost / BeRoEXEPacker.txt
Created April 30, 2012 12:01
BeRoEXEPacker release note
BeRoEXEPacker is in the wild since mid 2006 and also was available to some folks, but until today I simply forgot to submit this thing to pouet.
For a list of the features and usage details see
http://www.rosseaux.com/page40_BeRoEXEPacker.html
It offers LZBRS, LZBRR, LZBRA, LZMA, LZBRCM and CTX1 compression. The compression method is selectable via command line parameter (default is LZMA). CTX1 is the slight modified and bugfixed algorithm from kkrunchy, which is included in BeRoEXEPacker since a few weeks.
It also can compress DLLs and has full support for TLS including TLS callbacks.
It's original purpose is the demo scene, where we need small executables, but it's also usable for general purpose as it offers a wide range of options and work modes.
@localhost
localhost / cit0day.rb
Created November 19, 2020 17:56
Cit0day breach check for password-store
#!/usr/bin/env ruby
ARGF.each do |l|
d = l.split(' ')&.first&.downcase&.gsub(/\Awww\./, '')
next unless d
`pass find #{d}`
end
@localhost
localhost / ._curl_timing_details.md
Created October 2, 2020 17:36
cURL: Show request timing details

Inspired by Joseph Scott's post¹ and Radovan Svedic's comment² let's have a nice box formatting for cURL's timing output.

Usage:

curl -sw "@$HOME/.curl_time.txt" https://ddg.gg/
    
# or without website output
curl -o /dev/null -sw "@$HOME/.curl_time.txt" https://ddg.gg/
@localhost
localhost / sshpass.rb
Last active August 17, 2020 10:34 — forked from cloverstd/sshpass.rb
brew install sshpass
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
sid factory 6.03 - abusing pulse pointer (5x) as "set tempo":
14b9 sta $1600
14bc sta $1601
14bf jmp $14ce
14c2 nop
14c3 nop
#!/usr/bin/env ruby
# find_gem - improved by freQvibez
#
# originally hacked by Dr Nic:
# http://drnic.tumblr.com/post/166472/load-up-any-gem-into-editor
#
# example: mate `find_gem mongrel mongrel_cluster`
require 'rubygems'
@localhost
localhost / tune_warp.rb
Created May 13, 2009 08:52
warp-o-mat: my 2nd Bloopsaphone tune (currently unfinished)
#
# -=) warp-o-mat (=-
# tune coded/composed by freQvibez
# (c) 2009 Alex Brem
#
# exclusively for why's BloopSaphone
#
# from Farbrausch with ♥
#
# type "webshare" to share the current directory, "webshare [PORT] /foo/bar"
# or "webshare -C /foo/bar" to share a different directory.
# use CTRL+C or /shutdown as URL to stop the server.
alias webshare='ruby -r webrick -e "include WEBrick;s=HTTPServer.new(:Port=>ARGV[0]||8000,:DocumentRoot=>ARGV[1]||Dir::pwd);k=lambda{s.shutdown};s.mount_proc(\"/shutdown\",k);trap(:INT,k);s.start"'