Skip to content

Instantly share code, notes, and snippets.

View tomysmile's full-sized avatar

Tomy Ismail tomysmile

  • NITOZA
  • Dubai
View GitHub Profile
@tomysmile
tomysmile / ionic-listen-port-and-address.md
Last active October 18, 2015 15:39
Ionic: Listen to specific port and address

Makes Ionic server listen to all connection:

$ ionic serve -a

Ionic server listen to specific port:

$ ionic serve -p 8101
@tomysmile
tomysmile / app.js
Created October 19, 2015 07:21 — forked from jbavari/app.js
Node API server with CORS disabled, AngularJS controllers with proxy and no proxy, and the ionic.project settings to allow proxy
var express = require('express')
var app = express()
app.get('/api/feed', function(req, res) {
res.json({name: 'feed', items: ['first', 'second']})
})
var server = app.listen(3000, function () {
var host = server.address().address
@tomysmile
tomysmile / ionic-command.md
Last active October 19, 2015 13:40
Ionic: command list

Ionic command list :

Start your project:

$ ionic start [your-app-name] [based-template]

there are 3 based templates: blank, tabs, sidemenu and map

Choose your platform:

@tomysmile
tomysmile / git-reset.md
Last active October 24, 2015 05:40
Git: Reset

Remove remote branch

git push origin :[branch-name]

Remove stale remote brance

git remote prune origin
@tomysmile
tomysmile / mysql-export-import.md
Last active October 30, 2015 00:34
Mysql: Export Import

To export a mysql database (as a dump) from the command line run:

$ mysqldump database_name > database_exportname.sql
$ mysqldump -h hostname -u username -p wordpress > wordpress.sql

To export all databases:

$ mysqldump -A > all_dbs.sql
$ mysqldump --all-databases > all_databases_export.sql
@tomysmile
tomysmile / mysql_commands.md
Last active April 27, 2016 07:34 — forked from jasperf/access_from_web.md
MySQL Commands to create users, database, password and grant necessary privileges from the command line

Bash commands

starting the server

$ mysql.server start

stoping the server

$ mysql.server stop
@tomysmile
tomysmile / create-user.md
Created November 1, 2015 04:51
mysql: create user
mysql> CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'user_name'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'%' WITH GRANT OPTION;
mysql> flush privileges;
@tomysmile
tomysmile / rpi-wifi.md
Created November 18, 2015 06:36
Raspberry: WIFI Settings

At the prompt, enter the following command:

sudo nano /etc/network/interfaces

In the nano text editor, you’ll see something like this:

auto lo
@tomysmile
tomysmile / rpi-update.md
Created November 18, 2015 06:42
Raspberry: Update
$ sudo apt-get update
$ sudo rpi-update
@tomysmile
tomysmile / rpi-find-in-network.md
Created November 18, 2015 07:09
Raspberry: Find your PI in Network from Mac OSX

Get Network Scanner to Find the Pi

You'll need to find your Pi on your network if its headless and you don't know it's IP. I used nmap. On MacOS this is available via homebrew:

$ brew install nmap

#Find your Raspberry Pi

To use it, from the command line, tell it to scan your network for machines with port 22 open (the SSH port):