Skip to content

Instantly share code, notes, and snippets.

View rm--'s full-sized avatar

René rm--

View GitHub Profile
@rm--
rm-- / nc_file_send.md
Last active August 9, 2023 12:56
send file via network (e.g. WLAN) and netcat

reveiver

nc -l 8080 > <new file>

sender

cat <existing file> | nc < receiver IP address > 8080

@rm--
rm-- / gist:ca0f6aec90c8ac5c867bf8c0f90d9a17
Created November 12, 2018 21:25
reduce size of spotify cache macos
1. Close Spotify.
2. Locate the Spotify prefs file:
~/Library/Application Support/Spotify/prefs
3. Open the file in your favorite text editor
4. Add another line and put a value in megabytes right after the equals sign. I chose 1024mb.
@rm--
rm-- / EvalExample1.scala
Last active October 26, 2018 11:29 — forked from harmeetsingh0013/EvalExample1.scala
scratch file
import cats._
val eager = Eval.now {
println("Hey !! I am eager eval")
"Hello Eval Eager"
}
val lazyEval = Eval.later {
println("Hey !! I am lazy eval")
"Hello Eval Lazy"
@rm--
rm-- / IdExample1.scala
Last active October 26, 2018 10:44 — forked from harmeetsingh0013/IdExample1.scala
scratch file
import cats._
import cats.syntax.flatMap._
import cats.syntax.functor._
import cats.syntax.applicative._
def sumSquare[F[_]: Monad](a: F[Int], b: F[Int]): F[Int] = {
a.flatMap(x => b.map(y => x*x + y*y))
}
import cats.instances.list._
@rm--
rm-- / brewlist
Created September 30, 2018 20:37
brew list
# $ brew list CW 39|30.09.18|22:07:26
ammonite-repl
ansible
apr
apr-util
autoconf
automake
bash
bat
binutils
@rm--
rm-- / bash_args.sh
Created September 30, 2018 19:29
bash arguments
#!/usr/bin/env bash
set -EeuCo pipefail
@rm--
rm-- / gist:9a73ba6dd9fad7215f20edd2d171743d
Created May 20, 2018 20:47
Turn off macOS iTerm2 beep sound
Preferences -> Profiles -> Terminal tab -> Check "Silence bell"
@rm--
rm-- / url_encode_decode.py
Created March 1, 2018 15:41
url encode and decode in python (alias)
urlencode='python3 -c "import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]))"'
urldecode='python3 -c "import sys, urllib.parse as ul; print(ul.unquote_plus(sys.argv[1]))"'
@rm--
rm-- / serve_file_with_nc.md
Last active February 1, 2018 10:01
One command line web server using nc (netcat)

serve file as response

(macOS) while true; do printf 'HTTP/1.1 200 OK\r\n\r\n'; cat <file>; | nc -l 10100; done

(linux) while true; do printf 'HTTP/1.1 200 OK\r\n\r\n' && cat <file> | nc -l -p 10100; done