#!/bin/bash | |
# Updating Ubunut | |
echo "updating ubunutu... please be patient" | |
apt-get update && apt-get upgrade -y | |
echo "installing required packages... please be patient" | |
apt-get install htop lib32gcc1 -y | |
# Create steam user if needed |
#include <IRremote.h> | |
IRsend irsend; | |
#define onOffReceived 10 | |
#define energyRcv 11 | |
#define avMode 12 | |
#define input 13 | |
#define tvRad 14 | |
#define list 15 | |
#define quickView 16 | |
#define volumeUp 17 |
With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?
- Go to
/etc/init/
$ sudo vim yourapp.conf
- Paste script.conf
$ sudo start yourapp
- And when you wanna kill the process
$ sudo stop yourapp
#!/bin/bash | |
MONGO_DATABASE="your_db_name" | |
APP_NAME="your_app_name" | |
MONGO_HOST="127.0.0.1" | |
MONGO_PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
BACKUPS_DIR="/home/username/backups/$APP_NAME" |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.
http://www.w3.org/TR/WebCryptoAPI/
This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.
import requests | |
uf = False # Unfollow all (currently followed) users? | |
f = True # Follow all (currently unfollowed) users? | |
def url(path, page=1, auth=""): | |
return "https://api.github.com" + path + "?page=" + str(page) + "&access_token=" + auth | |
def unfollow(user): | |
requests.delete(url("/user/following/" + user["login"], 1, auth)) |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |