Saturday, May 16, 2020

VS Addons

Addons to make visual studio better...

GitDiffMargin
This provides a much better change indicator on the column left of VS editor. It does not remove VS default change indicator there and shows itself alongside it. I disable the the VS change indicator after installing this addon:

 Tools -> Options -> Text Editor -> Advanced -> Show the difference overview margin

WhackWhackTerminal
This adds a nice little terminal window. After installation, enable it from  :
 View -> Other windows -> Terminal Window  

Want to use git bash instead of command prompt?
 Tools -> Options -> Whack Wack Terminal -> General -> Shell Path  

Auto Save File
This saves modified files on focus lose.

Wednesday, October 17, 2018

human readable \x string

See the value using:
 str = br"\x??"  
 str.decode('unicode-escape').encode('latin1').decode('utf-8')  

Saturday, August 4, 2018

backup and restore on postgres

Wanna backup and restore postgres db?
 pg_dump -Fc -Z 9 -U postgres -W --file=file.dump db_name  
 pg_restore -Fc -j 8 -U postgres -W -d db_name file.dump  

Saturday, July 14, 2018

Useful docker aliases

Some useful bash aliases:
 alias build="docker-compose build --no-cache"  
 alias up="docker-compose up -d"  
 alias logs="docker-compose logs --tail 50 -f"  
 alias run="docker-compose exec"  
 alias stop="docker-compose stop"  
 alias purge-containers="docker ps -aq | xargs docker rm"  
 alias purge-images="docker images -a | grep '<none>' | awk '{print $3}' | xargs docker rmi"  

Saturday, June 23, 2018

Gradle to use socks5 proxy

Gradle to use socks5 proxy?
Set this inside gradle.properties

 org.gradle.jvmargs=-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=7077  

Wednesday, May 23, 2018

Install MySQL for python within venv

Yup. Not intuitive.

 pip install mysql-connector-python --allow-external mysql-connector-python  

Sunday, March 18, 2018

Counter Strike with WINE

First install wine and cabextract

 sudo dnf install cabextract wine wine.i686  
Then install runtime libraries for visual C and Basic
 wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks  
 chmod +x winetricks  
 ./winetricks corefonts vcrun6 vb6run  
Install counter strike and run it like on windows.