Skip to content

Instantly share code, notes, and snippets.

View phx's full-sized avatar

phoenix phx

View GitHub Profile
@phx
phx / bind.c
Created September 30, 2023 00:51 — forked from stefansundin/bind.c
Bind programs to specific network interface. (Linux)
/*
https://gist.github.com/stefansundin/e4fce00d97f7694c7a27
http://www.ryde.net/code/bind.c.txt
http://daniel-lange.com/archives/53-Binding-applications-to-a-specific-IP.html
*/
/*
Copyright (C) 2000 Daniel Ryde
This library is free software; you can redistribute it and/or
@phx
phx / BUILD_SIGNAL_RELEASE_WITH_LOCKSCREEN.sh
Last active September 3, 2021 15:11
BUILD_SIGNAL_RELEASE_WITH_LOCKSCREEN
#!/usr/bin/env bash
cd $(cd -P -- "$(dirname -- "$0")" && pwd -P)
nvm install "$(cat .nvmrc)"
nvm use
git-lfs install &&\
npm install --global yarn &&\
sudo yarn install --frozen-lockfile || exit 1

Keybase proof

I hereby claim:

  • I am phx on github.
  • I am lllphxlll (https://keybase.io/lllphxlll) on keybase.
  • I have a public key ASDRydUr16F00Rv_-wbV37D9ST9yXq0NYmZKFpfQ3LN_Fgo

To claim this, I am signing this object:

@phx
phx / josh.sh
Last active December 7, 2017 22:27
josh prank
#!/bin/bash
osascript -e "set volume 7"
say -v Victoria 'JOSH has an imPORtant anNOUNCEment to-make'
sleep 1
say -v Whisper 'i have a SECRET to tell EVERYONE'
sleep 1
say -v 'Good News' 'i have no testickuls'
sleep 1
say -v 'Pipe Organ' 'but WAIT. theres MORE.'
@phx
phx / chromeos.usb.boot.sh
Created December 18, 2016 16:35
Chrome OS Enable USB Boot
# With Developer Mode Enabled:
# Ctrl-Alt+T in browser to bring up terminal tab
$ shell
$ sudo crossystem dev_boot_usb=1 dev_boot_legacy=1
$ sudo reboot
@phx
phx / dockerflatten.sh
Last active December 26, 2017 17:16
Flatten Docker image and re-import as smaller image
docker export image1_container | docker import -
docker rmi image1:latest
docker tag [IMPORTED IMAGE NAME] image1:latest
docker rmi [IMPORTED IMAGE NAME]
@phx
phx / README
Last active September 23, 2015 17:26
OS X port of img2sf: A script to generate screenfetch ASCII from an image. Original img2sf project link: https://github.com/cbarox/scripts/tree/master/img2sf
Dependencies: img2xterm (not available via Homebrew -- you will need to build from source, see below)
Rossy's img2xterm project link: https://github.com/rossy/img2xterm
Notes: I had to re-install ImageMagick for img2xterm to work properly.
Instructions:
$ brew update
$ brew reinstall imagemagick
$ git clone https://github.com/rossy/img2xterm.git
$ cd img2xterm && make && make install
@phx
phx / smsdb-alert.sh
Created September 15, 2013 06:32
This is a quick starter-template that could send SMS or email alerts from a jailbroken iOS device. Think "text-message forwarding" and/or related functionality.
#/bin/bash
TZ='America/Chicagp'
/usr/bin/sqlite3 /var/mobile/Library/SMS/txt.db <<!
.mode list
.separator |
.out txt.dmp
SELECT
m.rowid as RowID,
@phx
phx / apple-epoch.sh
Created September 8, 2013 08:14
Get Apple Epoch Time from Unix Epoch Time
#/bin/bash
# 1) create function to get current Unix Epoch Time
EPOCHTIME () { date -u +%s; }
# $ EPOCHTIME
# 1378623423
# $ EPOCHTIME
# 1378623429
# 2) get Unix Epoch Time at 12am on January 1, 2001, as STATIC variable
@phx
phx / sms-to-csv.sh
Last active November 23, 2020 17:38
Dump iOS SMS/iMessage database to CSV.
#/bin/bash
# not an actual script - these are only commands, but the script would be basically the same.
# requires jailbroken iOS device
# get into the filesystem
ssh root:alpine@iphone
# update your package list, and install sqlite
apt-get update