str = br"\x??"
str.decode('unicode-escape').encode('latin1').decode('utf-8')
Wednesday, October 17, 2018
human readable \x string
See the value using:
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
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.
Subscribe to:
Posts (Atom)