Skip to content

Instantly share code, notes, and snippets.

@gaoqi7
gaoqi7 / init.lua
Created April 4, 2023 15:56 — forked from prenagha/init.lua
Hammerspoon Config File, Hyper Key, Karabiner-Elements
-- hattip https://github.com/lodestone/hyper-hacks
-- hattip https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907
-- A global variable for the sub-key Hyper Mode
k = hs.hotkey.modal.new({}, 'F18')
-- Hyper+key for all the below are setup somewhere
-- The handler already exists, usually in Keyboard Maestro
-- we just have to get the right keystroke sent
@gaoqi7
gaoqi7 / aria2
Created April 30, 2020 18:19
command line download of torrent magnet link using aria2
# Command to download file via bittorrent magnet link using aria2.
# See website and documentation at https://aria2.github.io
# -d specifies the directory to store the downloaded file
# --seed-time=0 disables seeding after download has completed
aria2c -d ~/Downloads --seed-time=0 "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C"
@gaoqi7
gaoqi7 / rename.mjs
Last active April 30, 2020 05:00
Rename multiple files name with Nodejs
import fs from 'fs'
//* First Step *//
//Delete added junkfile
const firstStep = function () {
fs.readdir('./', (err, files) => {
@gaoqi7
gaoqi7 / ddwrt_config_dns
Created November 21, 2019 21:45
ddwrt use raspberry pi as dns
In ddwrt
service >> DNSMasq >> Additional DNSMasq Options
# my raspberry pi ip address is 192.168.1.98
dhcp-option=6,192.168.1.98
@gaoqi7
gaoqi7 / samba_mount
Last active November 21, 2019 20:57
mount samba folder
sudo mount -t cifs -o username=username,password=password //server/folder /mount/location
-inurl:htm -inurl:html intitle:"index of" +("/ebooks"|"/book") +(chm|pdf|zip) +"BookName"
@gaoqi7
gaoqi7 / brew-install-script.sh
Last active May 29, 2019 06:51
macOS setup
#!/bin/sh
# Homebrew Script for OSX
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh`
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing brew cask..."
brew tap caskroom/cask