Skip to content

Instantly share code, notes, and snippets.

View jquast's full-sized avatar
🐡
I may be slow to respond.

Jeff Quast jquast

🐡
I may be slow to respond.
View GitHub Profile
@ingramchen
ingramchen / gist:e2af352bf8b40bb88890fba4f47eccd0
Created April 5, 2016 12:58
ffmpeg convert gif to mp4, for best cross browser compatibility
### Full command line options
```
ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4
```
### Notie
* output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS.
@frnhr
frnhr / .bash_profile
Created March 17, 2016 22:39
Show current pyenv python version in bash prompt, and also color virtual envs differently
####
#### pyenv-virtualenv bash prompt customization
####
# pyenv
eval "$(pyenv init -)"
# pyenv-virtualenv:
@magnetikonline
magnetikonline / README.md
Last active March 16, 2024 02:00
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set, value is returned.

Combine with a : no-op to discard/ignore return value.
${variable="value"}
: ${variable="value"}
#!/usr/bin/env python2.7
"""
PyPacketMail for x/84, http://github.com/jquast/x84
(c) 2015 Michael Griffin <mrmisticismo@hotmail.com>
http://github.com/m-griffin/PyMailPacket
This is a FidoNet Echomail Scanner / Tosser for x84 bbs.
This will mimic the basic functionality of Crashmail for
Reading and Writing mail packets.
@nolageek
nolageek / pushover.py
Last active February 4, 2016 07:12
Pushover Notifications for x/84
import httplib, urllib
# Config
# You will need to sign up for a pushover.net account - and download
# their paid ios or android apps or their various 3rd party plugins.
# https://pushover.net/apps
appToken = "APPTOKEN HERE"
userKey = "USERKEY HERE"
@takluyver
takluyver / pexpect_async.py
Created June 7, 2014 01:01
Pexpect asyncio integration attempt
import asyncio
import pexpect
from pexpect.async import expect_async
p = pexpect.spawn('python')
p.setecho(False)
p.waitnoecho()
b = pexpect.spawn('bash')
b.setecho(False)
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@dergachev
dergachev / setuid-root-backdoor.md
Last active March 16, 2024 00:49
How to use setuid to install a root backdoor.

Why You Can't Un-Root a Compromised Machine

Let's say somebody temporarily got root access to your system, whether because you "temporarily" gave them sudo rights, they guessed your password, or any other way. Even if you can disable their original method of accessing root, there's an infinite number of dirty tricks they can use to easily get it back in the future.

While the obvious tricks are easy to spot, like adding an entry to /root/.ssh/authorized_keys, or creating a new user, potentially via running malware, or via a cron job. I recently came across a rather subtle one that doesn't require changing any code, but instead exploits a standard feature of Linux user permissions system called setuid to subtly allow them to execute a root shell from any user account from the system (including www-data, which you might not even know if compromised).

If the "setuid bit" (or flag, or permission mode) is set for executable, the operating system will run not as the cur

@dankrause
dankrause / _hover_example.py
Last active March 8, 2024 18:31
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)