Skip to content

Instantly share code, notes, and snippets.

View NothingCtrl's full-sized avatar

Thang Duong Bao NothingCtrl

View GitHub Profile
@NothingCtrl
NothingCtrl / __app_sync.php
Created November 26, 2015 03:14
Sync files/folders between two folder
<?php
/**
* Created by PhpStorm.
* User: thangdb
* Date: 25/11/15
* Time: 2:28 PM
*
* File này dùng để sync giữa folder development và folder production của app
*/
@NothingCtrl
NothingCtrl / __app_sync.php
Created November 26, 2015 16:18
Auto sync file between two folders
<?php
/**
* Created by PhpStorm.
* User: thangdb
* Date: 25/11/15
* Time: 2:28 PM
*
* File này dùng để sync giữa folder development và folder production của app
*/
$start = microtime(true);
# coding=utf-8
__author__ = 'thangdb'
import os
import datetime
import shutil
# thư mục gốc
source_folder = 'D:\BKH\PUBLIC'
# thư mục chứa các file sẽ move
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
@NothingCtrl
NothingCtrl / gist:6ea49db82bf41dcf9e519f00d5904faf
Created October 20, 2017 19:33 — forked from yhara/gist:1408888
GitHub Emoji (sort by category)
emotion :+1: :-1: :clap: :heart: :sparkles: :v: :zzz:
icon :new: :ok: :cool: :vs: :tm: :warning: :wheelchair: :zap: :art: :bomb: :bulb: :key: :lock: :memo: :mag:
item :book: :gift: :moneybag: :mega: :scissors: :hammer:
device :computer: :iphone: :calling: :email:
human :cop: :runner: :feet: :fist: :punch: :lipstick: :tophat:
food :beer: :cake: :smoking:
behicle :airplane: :bike: :bus: :ski: :taxi: :train:
animal :bear: :fish: :octocat:
nature :fire: :leaves: :star: :sunny:
@NothingCtrl
NothingCtrl / mysql-docker.sh
Created December 13, 2017 04:18 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@NothingCtrl
NothingCtrl / Ubuntu_1604_flectra_installation.sh
Created December 27, 2017 10:15
Install Flectra On Ubuntu 16.04 LTS
#!/bin/bash
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/flectra --gecos 'flectra' --group flectra
sudo mkdir /etc/flectra && sudo mkdir /var/log/flectra/
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install postgresql postgresql-server-dev-9.5 build-essential python3-pillow python3-lxml python-ldap3 python3-dev python3-pip python3-setuptools npm nodejs git gdebi libldap2-dev libsasl2-dev libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev -y
sudo git clone --depth=1 --branch=master https://github.com/flectrahq/flectra.git /opt/flectra/flectra
sudo chown flectra:flectra /opt/flectra/ -R && sudo chown flectra:flectra /var/log/flectra/ -R && cd /opt/flectra/flectra && sudo pip3 install -r requirements.txt
sudo npm install -g less less-plugin-clean-css -y && sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /tmp && wget https://downloads.wkhtmltopdf.org/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && sudo gdebi -n wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && rm wkhtmltox-0.12.2.
@NothingCtrl
NothingCtrl / README.rst
Created May 27, 2018 09:29 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@NothingCtrl
NothingCtrl / ls_keep_alive.py
Last active May 27, 2018 13:53
Buffalo LinkStation keep alive
#!/usr/bin/env python
import socket
import time
import urllib2
bcast_addr = "10.254.254.255" # broadcast address for you network
target_mac = "4C:E6:76:92:3A:86" # colons are optional, case does not matter
mac = target_mac.replace(':', "")
@NothingCtrl
NothingCtrl / wol.py
Created August 11, 2019 17:02
Python3 WOL scrip
# Git: https://github.com/bentasker/Wake-On-Lan-Python
#!/usr/bin/env python3
#
# Based on wol.py from http://code.activestate.com/recipes/358449-wake-on-lan/
# Amended to use configuration file and hostnames
#
# Copyright (C) Fadly Tabrani, B Tasker
#
# Released under the PSF License See http://docs.python.org/2/license.html
#