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
import datetime | |
import pytz | |
#formula | |
utcnow = datetime.datetime.utcnow().replace(tzinfo=pytz.UTC) | |
Edinburgh= utcnow.astimezone(pytz.timezone('Europe/London')) | |
east = utcnow.astimezone(pytz.timezone('US/Eastern')) | |
cent = utcnow.astimezone(pytz.timezone('US/Central')) |
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 | |
echo 'installing Dev tools' | |
sudo apt-get install vim | |
sudo apt-get install curl | |
sudo apt-get install git | |
sudo apt-get install unzip | |
echo 'installing python tools' | |
sudo apt-get install python-pip |
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
grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" filename.txt > new list uniq | |
grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' EMAIL_SAMPLES.TXT | sort | uniq -i > fixthese.txt | |
grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' bouncedEmail.csv | sort | uniq -i > fixthese2.txt | |
#this will grab a little after the email address |
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 | |
#echo 'installing opensshserver ' | |
#sudo apt-get install openssh-server | |
echo 'installing opensh-client ' | |
sudo apt install openssh-client | |
echo 'installing vim' | |
sudo apt-get install vim | |
sudo apt-get install curl | |
sudo apt-get install git |
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
#to list installed apps | |
dpkg --get-selections | grep -v deinstall | |
#to copy list to a file | |
dpkg --get-selections | grep -v deinstall > mylist.txt | |
#to restore the packages/apps | |
dpkg --clear-selections | |
$ sudo dpkg --set-selections < mylist.txt |
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 install openssh-server | |
sudo apt-get install python-pip | |
sudo apt-get install python-pip3 | |
envhost / | |
vim | |
ipython jupyter |
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
#change to postgres user and open psql prompt | |
sudo -u postgres psql postgres` | |
#list databases | |
postgres=# \l | |
#list roles | |
postgres=# \du | |
#create role | |
postgres=# CREATE ROLE demorole1 WITH LOGIN ENCRYPTED PASSWORD 'password1' CREATEDB; |
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
https://github.com/ahmednuaman/gdrive-cms-py-gae | |
http://developer.android.com/training/basics/activity-lifecycle/pausing.html | |
#speed test from the command line | |
wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip | |
#kinn bikes | |
http://www.kickstarter.com/projects/kinnbikes/kinn-a-fast-family-friendly-transport-bike?ref=tag |
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
import pymongo | |
import sys | |
import traceback | |
# establish a connection to the database | |
connection = pymongo.Connection("mongodb://localhost", safe=True) | |
# get a handle to the school database | |
db=connection.school | |
students = db.students |
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
the Hash Rocket syntax (:foo => "bar") | |
is deprecated in favor of the new-to-Ruby JSON-style hash (foo: "bar") | |
run inside project | |
rvm use 1.9.3-p327@rails3 --rvmrc | |
rails new APP -T | |
rails generate controller Users new --no-test-framework | |
rails generate model User name:string email:string --no-test-framework | |
rails _3.2.13_ new demo #when the sytem has rails 4 but you want rails 3.2 |
NewerOlder