This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wsl --shutdown | |
diskpart | |
# open window Diskpart | |
select vdisk file="<path_to_vhdx>" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk | |
exit | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os.path import exists | |
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag | |
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()) | |
cuda_output = !ldconfig -p|grep cudart.so|sed -e 's/.*\.\([0-9]*\)\.\([0-9]*\)$/cu\1\2/' | |
accelerator = cuda_output[0] if exists('/dev/nvidia0') else 'cpu' | |
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.4.1-{platform}-linux_x86_64.whl torchvision |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
sudo apt-get install apt-transport-https | |
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list | |
sudo apt-get update | |
sudo apt-get install sublime-text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libx11-dev libxtst-dev libxinerama-dev libxkbcommon-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hg init || git init | |
hg add <path> || git add <path> | |
hg commit -m 'Commit message' || git commit -m 'Commit message' | |
hg commit || git commit -a | |
hg status || git status -s | |
hg clone <path> || git clone <path> | |
hg branch <branchname> || git checkout -b <branchname> (-b also switch to new branch) | |
hg pull & hg update || git pull --all | |
hg diff || git diff HEAD | |
hg rm || git rm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# display file with line numbers | |
cat file -n | |
# display gzipped file with line numbers | |
zcat file | cat -n | |
# display file from the i. line to j. line (that is j minus i there) | |
cat file | head -n j | tail -n j-i | |
# remove first line of the file (efficient) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /usr/share/geany/filetype_extensions.conf ~/.config/geany | |
echo "Go=*.go;" >> ~/.config/geany/filetype_extensions.conf | |
cp /usr/share/geany/filetypes.c ~/.config/geany/filedefs/filetypes.Go.conf | |
sed -i 's/extension=c/extension=go\nlexer_filetype=C/g' ~/.config/geany/filedefs/filetypes.Go.conf | |
sed -i 's/primary=.*/primary=break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var/g' ~/.config/geany/filedefs/filetypes.Go.conf | |
sed -i 's/secondary=.*/secondary=byte int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float32 float64 complex64 complex128 uintptr string/g' ~/.config/geany/filedefs/filetypes.Go.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "code.google.com/p/go-tour/tree" | |
import "fmt" | |
func _walk(t *tree.Tree, ch chan int) { | |
if t.Left != nil { | |
_walk(t.Left, ch) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"os" | |
"strings" | |
//"fmt" | |
"bytes" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-tour/pic" | |
"image" | |
"image/color" | |
) | |
type Image struct{ |
NewerOlder