Skip to content

Instantly share code, notes, and snippets.

View mattchainsaw's full-sized avatar

Matthew Meyer mattchainsaw

View GitHub Profile
@mattchainsaw
mattchainsaw / run.sh
Created May 11, 2016 21:37
Notification of job completion
#!/bin/bash
#
# This still works with piping and redirection of output.
# Ex)
# bash run.sh ./long_computation > long_computation.out
if [ ! $1 ]
then
echo "Usage: $0 <command>" >&2
fi
@mattchainsaw
mattchainsaw / where.sh
Last active May 11, 2016 21:37
Poetry for Plebs. Recursively search for instance of a string in all files and subfolders. Usage: ./where.sh <regex>
#!/bin/bash
find . -type f |
while read x
do
cat $x | egrep --color=always "$1" &&
echo -e "\e[36m$x\e[0m" &&
echo
done
@TemporaryJam
TemporaryJam / Howto convert a PFX to a seperate .key & .crt file
Last active April 13, 2021 15:54
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@benjaminplee
benjaminplee / dddd
Created November 7, 2012 02:11
foo
ddsdfdfd
@zpea
zpea / html5_video_conv.bash
Created July 21, 2012 03:00
little shell script to convert video files to the various HTML5 video formats/codecs using ffmpeg. Also generates the line for embedding the video using the videoJS plugin for wordpress.
#!/bin/bash
#
# video conversion script for publishing as HTML 5 video, via videojs (with hd button extension)
# 2011 by zpea
# feel free to use as public domain / Creative Commons CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/)
#
FFMPEG=/usr/bin/ffmpeg
HD_SUFFIX='_hd'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active March 28, 2024 11:13
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname