Skip to content

Instantly share code, notes, and snippets.

View zenwalk's full-sized avatar
🏠
Working from home

chenn zenwalk

🏠
Working from home
View GitHub Profile
#!/bin/bash
echo "install routeros on linux ubuntu 20"
wget https://download.mikrotik.com/routeros/6.44.6/chr-6.44.6.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=512 chr.img /mnt && \
ADDRESS=`ip addr show eth0 | grep global | cut -d' ' -f 6 | head -n 1` && \
GATEWAY=`ip route list | grep default | cut -d' ' -f 3` && \
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY
/ip service disable telnet
@zenwalk
zenwalk / mp4.sh
Created November 23, 2024 17:38 — forked from djotto/mp4.sh
Merge multiple mp4 files as chapters
#! /usr/bin/env bash
####################################################
# Required Libraries
#
# library name | commands used | verified version
# ------------------------------------------------
# ffmpeg | ffmpeg/ffprobe | 3.1.4 3.2
# gpac | mp4box | 0.6.1
# mp4v2 | mp4chaps | 2.0.0
@zenwalk
zenwalk / For Mac 4.2.6 unlimited trial.md
Created January 22, 2024 16:47 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@zenwalk
zenwalk / append-ssh-authorized_keys.sh
Created November 24, 2023 09:06 — forked from STRRL/append-ssh-authorized_keys.sh
append my ssh pub key as ssh authorized_keys
#!/usr/bin/env bash
mkdir -p ~/.ssh
# if authorized_keys not exist, create it
if [ ! -f ~/.ssh/authorized_keys ]; then
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
fi
curl -L http://github.com/strrl.keys >> ~/.ssh/authorized_keys
# Attribute: userinfo-url={{print .subscribe_url}}
# Attribute: filename={{hostOf .subscribe_url}}.yaml
ipv6: true
mixed-port: 7890
mode: rule
allow-lan: true
log-level: info
external-controller: 127.0.0.1:6170
@zenwalk
zenwalk / .block
Created April 28, 2023 18:58 — forked from texodus/.block
Perspective / Movies
license: apache-2.0
height: 800
@zenwalk
zenwalk / ffmpeg-watermark.md
Created April 28, 2023 18:58 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@zenwalk
zenwalk / zmv-examples.md
Created April 28, 2023 18:58 — forked from niksmac/zmv-examples.md
ZMV-Examples (require autoload zmv)

rename a section of a filename, i. e. example.1.{txt,conf,db} or 12345.1.{wav,ogg,mp3} and

change the 1 to a 2 in the filename while preserving the rest of it.

$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'

Rename files to lower case

$ zmv '*' '${(L)f}'

serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)

$ autoload zmv

@zenwalk
zenwalk / advanced_rasterio_features.ipynb
Created April 28, 2023 18:58 — forked from sgillies/advanced_rasterio_features.ipynb
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.