Skip to content

Instantly share code, notes, and snippets.

View george124816's full-sized avatar

George Rodrigues george124816

View GitHub Profile
localectl set-x11-keymap us pc105 intl
@george124816
george124816 / sound.org
Created June 15, 2022 13:02
change audio output on linux
pactl set-sink-port alsa_output.pci-0000_09_00.4.analog-stereo analog-output-headphones
pactl set-sink-port alsa_output.pci-0000_09_00.4.analog-stereo analog-output-lineout
@george124816
george124816 / vpn
Last active September 30, 2022 18:57
VPN Script
#!/bin/elixir
System.argv()
|> case do
["up"] ->
System.cmd("nmcli", ["connection", "up", "work"])
|> IO.inspect()
["down"] ->
System.cmd("nmcli", ["connection", "down", "work"])
@george124816
george124816 / myip
Last active October 14, 2022 13:16
retrieve ipv4 and ipv6 from cli
#!/bin/bash
# pacman -S dnsutils
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
dig +short txt ch whoami.cloudflare @1.0.0.1
@george124816
george124816 / example.org
Created May 18, 2022 22:42
Some org mode and babel execution

Example Org Mode with Org Babel

Variables

echo "https://api.ipify.org"
#!elixir
case System.argv() do
["up"] ->
"nmcli connection up work"
|> String.to_charlist()
|> :os.cmd()
|> List.to_string()
|> String.trim()
|> IO.puts()
# interactive command
gpg2 --full-generate-key
# get keyID
gpg2 --list-secret-keys --keyid-format=long
att .gitconfig with KEYID
`git config --global user.signingkey 3AA5C34371567BD2`
@george124816
george124816 / sqrt.ex
Created June 5, 2021 13:28
Square Roots by Newton's Method
defmodule Sqrt do
def sqrtiter(guess, x) do
if (goodenought?(guess, x)) do
guess
else
guess
|> improve(x)
|> sqrtiter(x)
end