Skip to content

Instantly share code, notes, and snippets.

@psiborg
psiborg / mtdl.sh
Last active October 8, 2021 13:23
Batch download a list of URLs
#!/bin/bash
dir="$1"
[ $# -eq 0 ] && { echo "Usage: $0 prefix"; exit 1; }
if [ ! -d "$dir" ]
then
mkdir $dir
fi
@psiborg
psiborg / mx_linux.md
Last active April 5, 2023 20:02
MX Linux
  • Live:
    • Username: demo
    • Password: demo

Installation

  • Domain: local
@psiborg
psiborg / kodi_asian_fonts.md
Last active September 27, 2021 10:28
Display Asian filenames in Kodi
@psiborg
psiborg / ren.sh
Last active September 20, 2021 19:56
Sequentially rename jpg files in a folder
#!/bin/bash
a=1
for i in *.jpg; do
new=$(printf "$1-%04d.jpg" "$a") #04 pad to length of 4
mv -i -- "$i" "$new"
let a=a+1
done
@psiborg
psiborg / flac-mp3.sh
Created September 15, 2021 03:57
ffmpeg
#!/bin/sh
for f in *.flac; do
ffmpeg -i "$f" -ab 128k -map_metadata 0 -id3v2_version 3 "${f%".flac"}.mp3"
done
@psiborg
psiborg / formats.md
Last active September 20, 2021 18:32
youtube-dl
youtube-dl -F https://www.youtube.com/watch\?v\={ID}
[youtube] {ID}: Downloading webpage
[info] Available formats for {ID}:
format code  extension  resolution note
249          webm       audio only tiny   50k , webm_dash container, opus @ 50k (48000Hz), 15.30MiB
250          webm       audio only tiny   56k , webm_dash container, opus @ 56k (48000Hz), 16.93MiB
@psiborg
psiborg / jsc.md
Last active August 27, 2021 20:59
JavaScriptCore - JavaScript runtime in the macOS terminal
@psiborg
psiborg / web-servers.md
Created May 20, 2021 03:14 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@psiborg
psiborg / pop_os.md
Last active May 13, 2021 03:22
Pop!_OS

Pop OS

sudo apt install htop

sudo apt install ffmpeg

sudo apt install vlc
@psiborg
psiborg / import.bat
Last active January 25, 2021 19:21
Import Shapefiles to SQL Server
@echo off
set osgeopath="C:\OSGeo4W64\bin"
set basepath="C:\Users\{username}\Downloads\Esri"
rem echo %osgeopath%
rem echo %basepath%
cd "%basepath%\GIS_Data_&_Maps_CD1[World_Europe]\europe\basemap"
for %%f IN (*.shp) DO %osgeopath%\ogr2ogr.exe -overwrite -f MSSQLSpatial "MSSQL: Driver={SQL Server Native Client 11.0}; Server=localhost; Database=esri_europe_basemap; Trusted_Connection=yes" "%%f"