Skip to content

Instantly share code, notes, and snippets.

@steven2358
steven2358 / ffmpeg.md
Last active May 5, 2024 12:45
FFmpeg cheat sheet
@CodeBrauer
CodeBrauer / mount-image-qcow2-from-kvm-on-macos.md
Last active April 17, 2022 09:24
Mount image (qcow2) from KVM on macOS - fastest way? / Convert qcow2 to access files (EXT4 partition)

If you haven't installed any FUSE yet:

brew tap homebrew/fuse
brew install Caskroom/cask/osxfuse
  1. brew install qemu ext4fuse
  2. qemu-img convert -p -O vmdk snapshot.qcow2 system.vmdk This will take some time...
  3. Download and register for a free licence of VMDK Mounter for Mac® OS X and install it.
  4. Reboot your macOS device.
@pichuang
pichuang / upgrade_ovs_in_mininet.sh
Last active August 26, 2021 16:39
Installing new version of Open vSwitch 2.3.0 use Mininet
#!/bin/sh -ev
# Reference: https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch
# How to test: ovs-vsctl -V
# Check permission
test $(id -u) -ne 0 && echo "This script must be run as root" && exit 0
#Remove old version ovs
aptitude remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller openvswitch-pki openvswitch-switch -y
@edokeh
edokeh / index.js
Last active May 6, 2024 01:02
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@Haraguroicha
Haraguroicha / upup_ss.js
Last active January 26, 2016 08:22
change custom dimension for up up. ref: http://small-upup.upuptoyou.com/ Note: this is paste and run in DevTools console panel
(function(){
//以下可自行修改,目前可7行且最多14字
var userWidth = 900; //我是寬度
var userHeight = 680; //我是高度
var userWords = ''; //我是預設文字
var userColor = ''; //我是背景色彩
//以下請勿修改
if(location.href.match(/https?:\/\/small-upup\.upuptoyou\.com\/?/) != null) {
$('#words').val(userWords === '' ? 'Modify By:\n腹黒い茶 \nQQQQ QQQQ !!\nQ Q Q Q !!\nQ QQ Q QQ !!\nQQQQ QQQQ\n Q Q !!' : userWords);
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@darrenderidder
darrenderidder / bashpath.sh
Created May 16, 2011 15:24
Get path of running script in bash
#!/bin/bash
# A simple test script to demonstrate how to find the
# "absolute path" at which a script is running. Used
# to avoid some of the pitfals of using 'pwd' or hard-
# coded paths when running scripts from cron or another
# directory.
#
# Try it out:
# run the script from the current directory, then