You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.6 KiB



Write code like it's synchrone

let get = async (URL) => {
    const retval = await fetch(URL)
    if (retval.ok) {
        this.playlists = await retval.json()
    } else {
        console.error("doh! network error")

Or use promise chaining

    .then(stream => stream.json())
    .then(data => this.playlists = data)
    .catch(error => console.error(error))


auto-reply y on installations or fsck repairs

yes | pacman -S <something>


extract audio-only from video file with ID3 tags

ffmpeg -i <input video>  -metadata title="Title" -metadata artist="Artist" -ab 256k file.mp3


<style type="text/css">
    table { page-break-inside:auto }
    tr    { page-break-inside:avoid; page-break-after:auto }
    thead { display:table-header-group }
    tfoot { display:table-footer-group }


drop all but accept from one ip

iptables -A INPUT -p tcp --dport 8000 -s -j ACCEPT
iptables -A INPUT -p tcp --dport 8000 -j DROP

drop all incomming ssh connections

iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j DROP


Delete all containers

  • docker rm $(docker ps -a -q)

Delete all images

  • docker rmi $(docker images -q)

Delete all dangling images

  • docker rmi $(docker images -f dangling=true -q)

Create docker network

  • docker network create mynet

clean up

  • docker system prune
  • docker volume rm $(docker volume ls -q --filter dangling=true)

run two docker img container with different names foo and bar and the can reach each other with domain name foo and bar

  • docker run --name foo --net mynet img
  • docker run --name bar --net mynet img


Set git to use the credential memory cache

git config --global credential.helper cache

Set the cache to timeout after 1 hour (setting is in seconds)

git config --global credential.helper 'cache --timeout=3600'

Set default editor

git config --global core.editor "vim"


search and download first match

youtube-dl ytsearch:damniam

set auto id3 tags

youtube-dl --prefer-ffmpeg --embed-thumbnail --add-metadata --metadata-from-title "%(artist)s - %(title)s" --audio-quality 0 --audio-format mp3 --extract-audio


for rom converting

community/ecm-tools 1.03-1 [Installiert]
    Error Code Modeler

ecm2bin rom.img.ecm


list all rules

  • ufw status

disable/enable firewall

  • ufw enable
  • ufw disable