Skip to content

Instantly share code, notes, and snippets.

View GongT's full-sized avatar
😺
meow meow

sbYm GongT

😺
meow meow
View GitHub Profile
@GongT
GongT / remote-connect.md
Last active June 11, 2017 03:36
from linux shell, remote open chrome on windows

On windows

create a link to chrome inside WSL. this will only run after Creators Update

echo '#!/bin/bash

cd /mnt/c
exec "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" "$@"
' > /usr/local/bin/chrome
chmod a+x /usr/local/bin/chrome
@GongT
GongT / bashrc.sh
Created June 10, 2017 22:58
tmux wrapper. attach without arguments.
function tmux {
if [ $# -eq 0 ]; then
if /usr/bin/tmux list-sessions &>/dev/null ; then
/usr/bin/tmux attach
else
cd ~
/usr/bin/tmux
fi
else
/usr/bin/tmux "$@"
@GongT
GongT / tscp.sh
Last active June 10, 2017 22:45
run `tsc -w`, clear terminal before re-compile. save to .bashrc file
# : https://gist.github.com/GongT/f8b65c7db0eb081a8c741f59b552f984
function tscp {
echo -en "\ec\0typescript compiling (source: $1)...\r"
tsc -w -p "$1" | sed 's/^.*File change detected/\x1Bc\0/g'
}
@GongT
GongT / cygwin-startx.sh
Created June 10, 2017 22:31
start X.org on windows with cygwin.
#/bin/bash
# create a LNK file:
# C:\cygwin64\bin\mintty.exe -w hide -h error -e /bin/env /usr/local/bin/startx.sh
# ^ cygwin install path ^ this file path in cygwin root
set -x
set -e
export PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin"
@GongT
GongT / gist:cb5c429a79834f73eff6041726a4d76a
Last active June 5, 2017 15:36
my linux virtual machine init script
# curl https://gist.githubusercontent.com/GongT/cb5c429a79834f73eff6041726a4d76a/raw/92eb636b4b8151af7b4e336e535b0003599fb4fc/gistfile1.txt | bash
# disable firewall & selinux
setenforce 0
echo -e "SELINUX=permissive\nSELINUXTYPE=targeted\n" > /etc/sysconfig/selinux
systemctl disable firewalld
systemctl stop firewalld
systemctl mask firewalld
# install docker client only