This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
versionMaj="1" | |
versionMin="0" | |
versionRev="1" | |
version="$versionMaj.$versionMin-$versionRev" | |
echo "Removing old Postman tarballs" | |
rm -f $(ls Postman*.tar.gz) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First you update your system | |
sudo apt-get update && sudo apt-get dist-upgrade | |
# Clean-up System | |
sudo apt-get purge epiphany-browser epiphany-browser-data #browser | |
sudo apt-get purge midori-granite #browser | |
sudo apt-get purge noise | |
sudo apt-get purge scratch-text-editor #text-editor | |
sudo apt-get purge modemmanager | |
sudo apt-get purge geary #email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getTotalDaysInYear = () => { | |
let year = new Date().getFullYear(); | |
if (year % 4 === 0) { | |
return 366; | |
} else { | |
return 365; | |
} | |
}; | |
let getCurrentDayOfYear = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getInfoFromNIC = nicNumber => { | |
// NIC Numbers have 10 characters | |
if (nicNumber.length > 10) { | |
throw new Error("NIC Number is too long."); | |
} | |
if (!_validateNIC(nicNumber)) { | |
throw new Error("NIC Number doesn't seem valid."); | |
} | |
let gender = _getGender(nicNumber); | |
let dateOfBirth = _getDate(nicNumber); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.shadow-stuff { | |
-moz-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
-webkit-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
-moz-box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
-webkit-box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
} | |
.container { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd .. | |
echo "[!] Stopping existing application" | |
ssh [email protected] "pm2 stop x-backend" | |
echo "[!] Removing existing folder" | |
ssh [email protected] "rm -rf /home/ubuntu/backend" | |
echo "[!] Copying files.." | |
rsync -azP backend [email protected]:/home/ubuntu/ -vv --exclude node_modules --exclude misc | |
echo "[!] Runing yarn on files.." | |
ssh [email protected] "cd /home/ubuntu/backend && yarn" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get install python3-setuptools | |
sudo easy_install3 pip | |
pip -V | |
#pip 9.0.1 from /usr/local/lib/python3.5/dist-packages/pip-9.0.1-py3.5.egg (python 3.5) | |
sudo chown -R username:username ~/.local/ | |
# add to ./*shrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checkout, compile & install | |
git clone https://github.com/facebook/watchman.git | |
cd watchman/ | |
git checkout v4.9.0 | |
sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool | |
./autogen.sh | |
./configure | |
make | |
sudo make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
git clone https://github.com/facebook/watchman.git | |
cd watchman/ | |
git checkout v4.7.0 | |
sudo apt-get install -y autoconf automake build-essential python-dev libtool libssl-dev | |
./autogen.sh | |
./configure | |
make | |
sudo make install |