Skip to content

Instantly share code, notes, and snippets.

@timaschew
timaschew / tarcheatsheet.md
Created October 15, 2022 20:29 — forked from haskaalo/tarcheatsheet.md
Tar usage / Tar Cheat Sheet

Tar Usage / Cheat Sheet

Compress a file or directory

e.g: tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

  • -c: Create an archive.
  • -z: Compress the archive with gzip.
  • -v: makes tar talk a lot. Verbose output shows you all the files being archived and much.
  • -f: Allows you to specify the filename of the archive.
@timaschew
timaschew / client.js
Last active February 22, 2023 07:04
Peerjs with peerID validation by using ed25519
import Peer from "peerjs"
import * as ed from "@noble/ed25519";
import { Buffer } from "buffer"
(async function() {
const privateKey = ed.utils.randomPrivateKey()
const _message = Date.now().toString(16)
const message = Uint8Array.from(Buffer.from(_message, "hex"))
const publicKey = await ed.getPublicKey(privateKey)
const peerId = Buffer.from(publicKey).toString("hex")
@timaschew
timaschew / deps.yml
Created March 11, 2021 14:19
Overall distance for a directed graph
dependencies:
n10:
depends_on:
- n11
n11:
depends_on:
- n12
n12:
depends_on:
- n13

And this the working output for mpga via HTTP:

vlc -vvv alsa://hw:1,0 --sout '#transcode{vcodec=none,acodec=mpga,ab=128,channels=2,samplerate=44100}:standard{access=http,mux=mp3,dst=192.168.178.30:8080}'
VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[00af1b58] main libvlc debug: VLC media player - 3.0.8 Vetinari
[00af1b58] main libvlc debug: Copyright © 1996-2019 the VideoLAN team
[00af1b58] main libvlc debug: revision 3.0.8-0-gf350b6b5a7
[00af1b58] main libvlc debug: configured with ./configure  '--build=arm-linux-gnueabihf' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/arm-linux-gnueabihf' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.8-0+deb10u1+rpt1' 
@timaschew
timaschew / change-mic-setup
Last active January 5, 2020 17:41
rhasspy
# still PyAudio but 2: USB audio device - hw 1,0
DEBUG:__main__:Wrote profile to /home/pi/.config/rhasspy/profiles/en/profile.json
[2020-01-04 16:36:58,045] 192.168.178.21:51981 POST /api/profile 1.1 200 66 35144
INFO:quart.serving:192.168.178.21:51981 POST /api/profile 1.1 200 66 35144
DEBUG:__main__:Restarting Rhasspy
DEBUG:PyAudioRecorder:started -> stopped
DEBUG:WebSocketObserver:started -> stopped
DEBUG:SnowboyWakeListener:listening -> stopped
DEBUG:PhonetisaurusPronounce:started -> stopped
@timaschew
timaschew / wtf.md
Created March 3, 2019 11:51
kaizhu256
@timaschew
timaschew / argumente.md
Last active September 5, 2018 07:43
Warum WhatsApp böse ist

Wenn man alle Messenger Dienste vergleich, ist das vermutlich wichtigste Merkmal die Verschlüsselung der Nachrichten. Signal bietet dabei die sogenannte Ende-zu-Ende Verschlüsselung an. Das bedeutet, dass die Nachrichten nicht vom Betreiber des Dienstes gelesen werden können und daher auch niemand sonst.

Innerhalb dieser Verschlüsselung gibt es verschiedene Methoden, diese zu erreichen. Signal benutzt dabei ein sehr gute, von Experten als extrem sicher eingestufte Variante. Es gibt noch viele andere Messenger-Dienste, die Ende-zu-Ende Verschlüsselung

@timaschew
timaschew / neb-alert-feed.html
Last active August 14, 2018 12:07
GTFS alert feed generator for NEB
<!DOCTYPE html>
<html lang="de">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8">
<meta name="viewport" content="width = device-width, initial-scale = 1.0">
<title>GTFS alert feed Generator for NEB</title>
<meta name="description" content="Offline Formular um GTFS Alert Feeds zu generieren">
<meta name="author" content="Anton Wilhelm">
<meta name="url" content="https://github.com/timaschew">
@timaschew
timaschew / alternative.js
Last active November 28, 2018 21:20
instagram contest analyzer and rollling the dice script
// roll the dice for instagram and wordpress comments
// you need to open web developer toolbar and open the console for these commands
//step 1: go to instagram post and ensure to load all comments
MIN_MENTION = 2;function unique(value, index, self) { return self.indexOf(value) === index;};copy(Array.prototype.slice.call($$(".k59kT li")).filter(e => e.querySelectorAll('.notranslate').length >= MIN_MENTION+1).map(e => e.querySelector('h3')).filter(e => e != null).map(e => e.textContent).filter(unique))
// step 2: go to wordpress backend and use edit mode for the page
r1 = <PASTE YOUR CLIPBOARD CONTENT>
// step 3: ensure to scroll to the bottom and load all comments