Skip to content

Instantly share code, notes, and snippets.

View lkonga's full-sized avatar
🎯
Focusing

lkonga lkonga

🎯
Focusing
View GitHub Profile
@lkonga
lkonga / fix_github_https_repo.sh
Created October 29, 2015 13:34 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@lkonga
lkonga / tubedlaudio.sh
Created November 12, 2016 06:07
download youtube audio and add to mpd
#!/bin/bash
clear
# install with: pip install --user youtube-dl
# TUBE=$HOME/.local/bin/youtube-dl
TUBE=/usr/local/bin/youtube-dl
# get all Formats here and search for m4a, return format codes
FORMAT=`$TUBE -F $1 | grep 'm4a' | cut -c -3`
# choose either 141 [256 kbit/s m4a] of 140 [
FORMAT=$( [[ $FORMAT =~ 141 ]] && echo 141 || echo `[[ $FORMAT =~ 140 ]] && echo 140` )
@lkonga
lkonga / gist:49390dafff0379583ebccd7bfe0b56b7
Last active October 16, 2017 17:34 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@lkonga
lkonga / msys2-setup.md
Created October 16, 2017 11:32 — forked from roblogic/msys2-setup.md
MSYS2 first time setup

If tmux fails with the message "open terminal failed: missing or unsuitable terminal: rxvt-unicode-256color".

$ ssh remotemachine mkdir -p .terminfo/r
$ scp /usr/share/terminfo/r/rxvt-unicode* remotemachine:.terminfo/r/
! to match gnome-terminal "Linux console" scheme
! foreground/background
URxvt.termName: rxvt-unicode-256color
!! Colors
/* #include ".config/colors/wombat" */
! true transparency (using unagi)
URxvt.depth: 32
!URxvt.background: [80]#000000
URxvt.background: Black
clear lock
clear control
add control = Caps_Lock Control_L Control_R
keycode 66 = Control_L Caps_Lock NoSymbol NoSymbol
#bind_to_address "127.0.0.1"
#bind_to_address "~/.mpd/socket"
music_directory "~/Downloads/music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/mpdstate"
audio_output {
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
! for cube
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = 1 exclam 1 exclam onesuperior exclamdown onesuperior
keycode 11 = 2 at 2 at twosuperior dead_doubleacute twosuperior
keycode 12 = 3 numbersign 3 numbersign threesuperior dead_macron threesuperior
keycode 13 = 4 dollar 4 dollar currency sterling currency
keycode 14 = 5 percent 5 percent EuroSign dead_cedilla EuroSign
keycode 15 = 6 asciicircum 6 asciicircum dead_circumflex onequarter dead_circumflex
keycode 16 = 7 ampersand 7 ampersand dead_horn onehalf dead_horn