Skip to content

Instantly share code, notes, and snippets.

View zh4n7wm's full-sized avatar
🎯
Focusing

Hydra zh4n7wm

🎯
Focusing
View GitHub Profile
@zh4n7wm
zh4n7wm / docker-cleanup-resources.md
Created September 17, 2018 08:56 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@zh4n7wm
zh4n7wm / Awesome-Networking.md
Created October 25, 2018 00:53
Awesome-Networking
@zh4n7wm
zh4n7wm / centos7-install-python3.md
Last active October 25, 2018 09:43
CentOS 7 install Python 3

why don't use pyenv

I tried pyenv, but it installed python 3.6 can not find fcntl module.

enable software collections

sudo yum install centos-release-scl

install python 3

extract audio from swf file, then save as mp3 file

$ ffmpeg -i input.swf -acodec copy output.mp3
$ for x in $(ls *.swf); do output=$(echo $x | sed 's/.swf/.mp3/'); ffmpeg -i $x -acodec copy ~/Downloads/nce-flash-01/$output; done

download m3u8 to mp4

$ ffmpeg -i https://media001.geekbang.org/13d6aa3bd2fd4f01a6ebc04771b88f0e/03d3c1eeedcc4854b9b5b5c1a88b8921-a37f6999637db379b3b9c31b62edfdc9-hd.m3u8 -c copy guoyu.mp4
#!/usr/bin/env python
import sys
import json
import types
def usage():
print('usage:')
print(
"""\techo '{"foo": [{"bar": "value"}]}' | """
### computer
- [index-of.es](http://index-of.es/)
- [lagout](https://doc.lagout.org/)
@zh4n7wm
zh4n7wm / course.md
Created December 13, 2018 05:46
初高中远程课堂
@zh4n7wm
zh4n7wm / traffic.md
Last active February 23, 2019 12:55
capture http traffic

tcpdump

capture http traffic, port: 8080

$ sudo tcpdump -i any -s 0 'tcp port 8080' -vv

@zh4n7wm
zh4n7wm / brewv.sh
Last active October 28, 2019 23:00 — forked from demosten/brewv.sh
Install specific version of a Homebrew formula
#!/bin/bash
#
# Install specific version of a Homebrew formula
#
# Usage: brewv.sh formula_name desired_version
#
# Notes:
# - this will unshallow your brew repo copy. It might take some time the first time
# you call this script
# - it will uninstall (instead of unlink) all your other versions of the formula.