Skip to content

Instantly share code, notes, and snippets.

View orjanv's full-sized avatar

Ørjan Hoyd H. Vøllestad orjanv

View GitHub Profile
@orjanv
orjanv / leapster-ubuntu-mount
Created May 17, 2014 19:14
Leapster Explorer Mounting on Ubuntu
#!/bin/bash
modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15
modprobe ubi mtd=0
ubidetach /dev/ubi_ctrl -m 0
ubiformat /dev/mtd0 -f erootfs.ubi
ubiattach /dev/ubi_ctrl -m 0
mount -t ubifs ubi0 temp
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# untitled.py
#
class class_name(object):
def __init__(self):
return
@orjanv
orjanv / gist:f05033316e96cde2b510
Last active September 12, 2019 02:12
Convert swf to gif
swfrender -o out.png fig_1853.swf
mogrify -resample 72x72 -resize 256x256 *.png
convert -delay 100 -loop 1 out-*.png animation.gif
convert -delay 10 -loop 1 -background white -alpha remove -layers OptimizePlus out-*.png animation.gif
convert \
-delay 10 \
$(for i in $(seq 0 5 100); do echo foo${i}.png; done) \
-loop 0 \
@orjanv
orjanv / handbrake-cli-encoding.sh
Created December 26, 2014 21:29
Handbrake CLI Encoding
#!/bin/bash
# http://www.davelachapelle.ca/guides/handbrake-cli-encoding/
# Your configuration stuff should go here - replace these with whatever you want
SRC=./SOURCE_FOLDER/
DEST=./DESTINATION_FOLDER/
DEST_EXT=mp4
HANDBRAKE_CLI=/Applications/HandBrakeCLI
PRESET="iPhone & iPod Touch"
#
# The meat of the script
@orjanv
orjanv / montage.sh
Created January 11, 2015 16:29
Montage
montage -mode concatenate -tile 3x3 tile*.jpg result.jpg
@orjanv
orjanv / .bashrc aliases
Last active November 23, 2016 10:21
Handy aliases for bash
alias mkdir='mkdir -pv'
alias mount='mount |column -t'
alias now='date +"%T"'
alias ports='netstat -tulanp'
alias header='curl -I'
alias df='df -H'
alias du='du -ch'
alias du1='du -d 1'
alias nocomment='grep -Ev '\''^(#|$)'\'''
alias bashrc='pico ~/.bashrc && source ~/.bashrc'
@orjanv
orjanv / actions.txt
Created April 27, 2016 17:29
Video actions on command line
# Flip a video 90 degrees clockwise
avconv -i in.mp4 -vf "transpose=1" -strict -2 out.mp4
@orjanv
orjanv / space_to-underline.sh
Created November 14, 2016 20:43
Bash script to replace spaces in file names
find -name "* *" -type f | rename 's/ /_/g'
@orjanv
orjanv / mic-level.sh
Created November 23, 2016 13:07
Command line script to capture sound higfher than
while :;do
rec -t raw /dev/null rate 32k silence 1 0.1 2% 1 0.0 2% && ping -c 1 localhost;
sleep 1;
done
@orjanv
orjanv / img-sound-to-video.sh
Created November 23, 2016 13:08
Use ffmpeg to create a video of a picture and a sound file
ffmpeg -loop 1 -i image.jpg -i audio.wav -c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 192k -pix_fmt yuv420p -shortest out.mp4