Skip to content

Instantly share code, notes, and snippets.

View alecthegeek's full-sized avatar
🤖
Dem keyboards don't go click click on their own you know

Alec Clews alecthegeek

🤖
Dem keyboards don't go click click on their own you know
View GitHub Profile
@alecthegeek
alecthegeek / mv-branch.sh
Created July 29, 2020 06:05
Move branches names on a local repo and push change to the remote. Defaults master -> main
#!/bin/bash
oldb="${1:-master}"
newb="${2:-main}"
git pull --all
git checkout $oldb
FROM debian:buster-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
nginx
@alecthegeek
alecthegeek / fedora notes
Created April 19, 2020 03:10
Fedora Notes
1. Package manager CLI is `dnf`
2. ALL the hardware works. Wifi, bt, function buttons
3. BT pairing and tethering was easy to set up
4. BT headphones took a few attempts to work
4. Good battery management
Snap:
Many apps (e.g. Spotify, Slack, ..) need to be installed with Snap
@alecthegeek
alecthegeek / demo.md
Last active April 11, 2019 04:31
A demo Markdown GIst

Title

Subtitle

  • A bullet point
  • And another

A Table

@alecthegeek
alecthegeek / json.ps1
Last active April 5, 2019 05:59
Json on the Powershell command line
# Run some program that needs to supply valid json strings (that contain `"`)
# note the use of backtick to escape newlines
# AND NOTE that from --% onwards the backtick no longer works. It must be on one line!
# This information helped me
# https://ss64.com/ps/syntax-esc.html
& 'C:\Program Files\<app>\<program>.exe' `
@alecthegeek
alecthegeek / profile.ps1
Last active March 14, 2019 04:00 — forked from sixeyed/profile.ps1
PowerShell profile with aliases for common Docker commands
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
}
function Remove-AllContainers {
docker container rm -f $(docker container ls -aq)
}
function Get-ContainerIPAddress {
param (
@alecthegeek
alecthegeek / boxstarter.ps1
Last active March 4, 2019 23:43 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Alec Clews <alec.clews@papercut.com> (forked from Jess Frazelle <jess@linux.com>)
# Last Updated: 2018-01-10
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@alecthegeek
alecthegeek / present.sh
Created February 22, 2019 18:17
Example script to set up video presentation mode on a Linux laptop
#!/bin/sh
xrandr --output HDMI-1 --same-as eDP-1 --auto --output eDP-1 --mode 1280x720
@alecthegeek
alecthegeek / markdownSectionNumbers.md
Last active December 9, 2018 04:01
How to add section numbers to markdown