Skip to content

Instantly share code, notes, and snippets.

View songpon's full-sized avatar

Songpon Phusing songpon

View GitHub Profile
@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
@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
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]
git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit -m "Removed submodule xxxx"
rm -rf .git/modules/<path_to_submodule>
@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
ls *.MP4 > input.txt
sed -i 's/^/file /g' input.txt
~/ffmpeg-20191114-73ee53f-win64-static/bin/ffmpeg.exe -f concat -i input.txt -c copy output.mp4
rm input.txt
@songpon
songpon / .gitignore_global
Created November 4, 2019 09:24
my git ignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.jasper
# https://raw.githubusercontent.com/tony/tmux-config/master/.tmux.conf
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-style bg=colour235,fg=colour136,default # bg=base02, fg=yellow
#crontab reboot need to use bash
set-option -g default-shell /bin/bash
# set window split
bind-key v split-window -h
#!/bin/bash
MASTER_IP=
SLAVE_IP=
# service postgresql stop
su - postgres
psql -c "CREATE ROLE replica WITH PASSWORD 'myreplpassword' LOGIN REPLICATION;"
#Security for master allow standby access
# Reference
# https://www.linuxcloudvps.com/blog/how-to-install-odoo-10-on-ubuntu-16-04-with-nginx-as-a-reverse-proxy/
# https://linuxize.com/post/configure-odoo-with-nginx-as-a-reverse-proxy/
# https://gist.github.com/plentz/6737338
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoo-chat {