Skip to content

Instantly share code, notes, and snippets.

View weblogix's full-sized avatar

Randy weblogix

View GitHub Profile
@weblogix
weblogix / Readynas.md
Last active August 14, 2021 02:46
[qBitorrent stop/start linux commandline]
#!/bin/bash

ROUTER_CHECK_HOSTNAME="mooo.com"
NAS_IP=$(curl ifconfig.me)
ROUTER_IP=$(getent hosts ${ROUTER_CHECK_HOSTNAME} | awk '{ print $1 }')
QBITTORRENT_STATUS=$(systemctl status fvapp-qbittorrentr6 | grep 'Active:')

if [[ "$QBITTORRENT_STATUS" =~ .*"active (running)".* && $NAS_IP == $ROUTER_IP ]]; then
 # Kill torrents
@weblogix
weblogix / guest_wifi.sh
Last active July 29, 2023 12:35
[openwrt cheatsheet]
# Sources
# https://openwrt.org/docs/guide-user/network/wifi/guestwifi/guest-wlan
# https://openwrt.org/docs/guide-user/network/wifi/guestwifi/extras
WIFI_DEV="radio0"
WIFI_PASSWORD="guest"
# Configure network
uci -q delete network.guest
uci set network.guest="interface"
@weblogix
weblogix / gif_to_mp4.md
Created October 3, 2020 01:34
[ffmpeg snippets] #ffmpeg

ffmpeg -r 30 -i input.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4

Here -r 30'' specify the frame rate 30 frames/sec. So if you want 10 sec movie with frame rate 30/sec, you make GIF animation that has total 300 frames, then use -r 30''.

@weblogix
weblogix / multiple_conditionals.md
Created September 16, 2020 05:57
[React snippets] #react
@weblogix
weblogix / webpack.md
Created September 3, 2020 06:26
[webpack] cheatsheeet

View all webpack processes

ps aux | grep webpack

Kill a single webepack process

kill -9 <process id>
@weblogix
weblogix / snippet.md
Created March 31, 2020 15:39
[rsync] rsync, without ssh, rsync daemon
export RSYNC_PASSWORD="BACKUP_PASSWORD_GOES_HERE" rsync -av --delete /var/backups/ rsync://backup@192.168.1.1:/backup/
@weblogix
weblogix / drevo-caliber.json
Last active May 2, 2021 14:46
[Karabiner-Elements] for DREVO Calibur 71-key Keyboard #mac #keyboard #karabiner
{
"title": "DREVO Calibur 71-key Keyboard",
"rules": [
{
"description": "Set ESC to grave_accent_and_tilde",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@weblogix
weblogix / mkv_to_mp4.md
Created July 13, 2019 08:17
[ffmpeg] #ffmpeg

Change mkv container to mp4 - with subtitles and all audio channels

ffmpeg -i test.mkv -c copy -map 0:4 -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c:s mov_text test.mp4

Batch:

for i in *.mkv; do ffmpeg -i "$i" -c copy -map 0:1 -map 0:0 -c:s mov_text "${i%.*}.mp4"; done
@weblogix
weblogix / npm_cheatsheet.md
Last active December 21, 2019 01:18
[npm cheatsheet] #npm

Update all packages

npm update --save/--save-dev

@weblogix
weblogix / cors.md
Created March 14, 2019 05:41
[AWS Cheatsheet] #aws