Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Find duplicate files using shell script
# Remove duplicate files interactively
TMP_FILE=$(mktemp /tmp/temp_file.XXX)
DUP_FILE=$(mktemp /tmp/dup_file.XXX)
function add_file() {
# Store the hash of the file if not already added
echo "$1" "$2" >> $TMP_FILE
}
@etng
etng / biaori-to-anki.js
Created June 18, 2021 06:23 — forked from breezewish/biaori-to-anki.js
将《新标准日语》的音频和单词导入到 Anki https://zhuanlan.zhihu.com/p/58139619
const assert = require("assert").strict;
const child_process = require("child_process");
const path = require("path");
const crypto = require("crypto");
const glob = require("glob");
const fs = require("fs-extra");
const _ = require("lodash");
const sort = require("alphanum-sort");
const Kuroshiro = require("kuroshiro");
const KuromojiAnalyzer = require("kuroshiro-analyzer-kuromoji");
@etng
etng / ffmpeg.md
Created May 21, 2021 05:22 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@etng
etng / vim_setup.sh
Created June 11, 2020 01:46
设置vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
cat<<'EOT'>~/.vimrc
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
let g:fzf_install = 'yes | ./install'
" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'do': g:fzf_install }
@etng
etng / Material Theme.itermcolors
Created January 23, 2020 01:26 — forked from Revod/Material Theme.itermcolors
Material Theme For iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.25882352941176473</real>
@etng
etng / Prose.md
Created October 31, 2019 08:00 — forked from shakna-israel/Prose.md
Obfuscating Python

Obfuscating Python

Obfuscation isn't difficult in most programming languages. It's why we have "good practices" because it is so easy to hide what you mean in badly written code.

Obfuscation tends to be even easier in dynamic languages because of how forgiving they tend to be - and because they tend to give you direct access to the environment so that you can manipulate it.

Today, for fun, I'm going to obfuscate this code:

def _(n):

if n <= 0:

@etng
etng / virt-install-centos
Created October 22, 2019 05:50 — forked from giovtorres/virt-install-centos
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@etng
etng / gist:6f7ad126e92fd4dc8c3b1451f494b897
Created July 13, 2018 03:45 — forked from timvlaer/gist:721ba30f8fc6a7aac1b0190e132a4261
Install Thrift 0.9.3 with brew on macOS
brew unlink thrift
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9d524e4850651cfedd64bc0740f1379b533f607d/Formula/thrift.rb
@etng
etng / extract0day.py
Created May 2, 2018 22:44
提取0day包中内容
from __future__ import print_function
import os
import glob
import sys
from shutil import rmtree, copyfile
unzip_path = '"C:/Program Files/7-Zip/7z.exe"'
unrar_path = '"C:/Program Files/WinRAR/rar.exe"'
dst = "D:/download/books1"
@etng
etng / docker-cleanup-resources.md
Created March 16, 2018 08:49 — 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