Skip to content

Instantly share code, notes, and snippets.

View BatmanAoD's full-sized avatar

Kyle J Strand BatmanAoD

View GitHub Profile
@zentralwerkstatt
zentralwerkstatt / instructions.md
Last active July 5, 2021 18:58
SSH into Linux Subsystem for Windows
  • In /etc/ssh/sshd_conf, set UsePrivilegeSeparation to no
  • In /etc/ssh/sshd_conf, temporarily enable plaintext passwords
  • In /etc/ssh/sshd_conf, change port (e.g. to 23) to avoid confusion with Windows SSH server
  • sudo service ssh restart
  • Add alternative port as a new rule to Windows firewall
  • On the client: ssh-copy-id user@server
  • In /etc/ssh/sshd_conf, re-disable plaintext passwords

To fix Could not load host key ... error:

  • sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
@thorrr
thorrr / Makefile
Last active January 2, 2016 15:09
Makefile for building cling from source. Works on win32 cygwin, need to modify the exename variable to make it work on Linux
cling-version := 45925
install-dir := $(shell pwd)/cling
exename := $(install-dir)/bin/cling.exe
.PHONY: all clean exe clang cling repl crepl cpprepl
all: exe
clean:
rm ./lastKnownGood
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active January 4, 2024 10:20
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@chriszf
chriszf / gist:2342247
Created April 9, 2012 08:07
FizzBuzz without conditionals
# SCREW YOU CONDITIONALS
def fizzbuzz(n):
fizzes = [1, 0, 0]
buzzes = [2, 0, 0, 0, 0]
words = [None, "Fizz", "Buzz", "FizzBuzz"]
for i in range(1, n):
words[0] = i
print(words[fizzes[i%3] + buzzes[i%5]])