Skip to content

Instantly share code, notes, and snippets.

View songpon's full-sized avatar

Songpon Phusing songpon

View GitHub Profile
@songpon
songpon / restore-remote-database.sh
Last active November 18, 2019 05:08
restore db from remoteserver
#!/bin/bash
FROM_DB="db1"
TO_DB="db2"
DBUSER="dbuser"
DBHOST="192.168.1.99"
pg_dump -h $DBUSER -U $DBUSER $FROM_DB | gzip > /tmp/dump.sql.gz
psql -h $DBUSER -U $DBUSER postgres -c "SELECT
git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit -m "Removed submodule xxxx"
rm -rf .git/modules/<path_to_submodule>
import glob
import os
if __name__ == "__main__":
res = glob.glob('*.MP4')
code='GH'
groups = {}
for r in res:
seq = r[2:4]
prefix = r[4:8]
@songpon
songpon / ubuntu-install-dremio.sh
Created February 5, 2020 04:07
ubuntu 18.04 install dremio driver
wget https://download.dremio.com/odbc-driver/1.4.2.1003/dremio-odbc-1.4.2.1003-1.x86_64.rpm
sudo apt-get install alien unixodbc-dev -y
sudo alien dremio-odbc-1.4.2.1003-1.x86_64.rpm
sudo dpkg -i dremio-odbc_1.4.2.1003-2_amd64.deb
@songpon
songpon / resize-lvm.sh
Last active March 18, 2020 04:09
resize full disk
lvdisplay
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv