Skip to content

Instantly share code, notes, and snippets.

View ahammond's full-sized avatar

Andrew Hammond ahammond

View GitHub Profile
@darko-mesaros
darko-mesaros / lolbanner-function.fish
Created May 28, 2020 11:32
Lolbanner alias / function that shows some colorfull text
function lolbanner
echo
figlet -c -f ~/.local/share/fonts/figlet-fonts/3d.flf $argv | lolcat
echo
end
@booherbg
booherbg / gist:b4f26a947c52ba31940c
Last active November 11, 2021 09:44
Setting up RetroPi + iBuffalo SNES controllers
The documentation online can be confusing, especially with config paths from old files floating around.
1. Download an image file for RetroPi (Ideally 2.5+)
2. Unzip the image file, plug in your SD card (likely /dev/sdb)
3. dd if=retropi.img of=/dev/sdb (this will erase your entire SD card)
4. Optional: increase the size of the new partition with gparted
System Setup
1. Add your ROMs to ~/RetroPi/roms/snes (which will cause your EmulationStation to now show the system in the menu). Be sure to unzip them.
2. (Not needed in RetroPie 2.5) Update your controller config, either by running ~/retropi_setup/retropi_setup.sh, or copying a known config to /opt/retropie/emulators/RetroArch/USB,2-axis8-buttongamepad.cfg
@scy
scy / opening-and-closing-an-ssh-tunnel-in-a-shell-script-the-smart-way.md
Last active May 8, 2024 05:28
Opening and closing an SSH tunnel in a shell script the smart way

Opening and closing an SSH tunnel in a shell script the smart way

I recently had the following problem:

  • From an unattended shell script (called by Jenkins), run a command-line tool that accesses the MySQL database on another host.
  • That tool doesn't know that the database is on another host, plus the MySQL port on that host is firewalled and not accessible from other machines.

We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like

ssh -L 3306:localhost:3306 remotehost

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 10, 2024 16:49
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname