Skip to content

Instantly share code, notes, and snippets.

View AJNOURI's full-sized avatar
💭
I may be slow to respond.

AJ NOURI AJNOURI

💭
I may be slow to respond.
View GitHub Profile
@AJNOURI
AJNOURI / opensuse42.3-gns3-install.txt
Created October 3, 2017 02:40
Steps to install gns3 on Opensuse Leap 42.3
############## latest QT
Download the latest unified Qt linux installer: wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
Make the downloaded file executable: chmod +x qt-unified-linux-x64-online.run
Become superuser: su (password)
Install gcc, make and friends: zypper install --type pattern devel_basis
Install Qt: ./qt-unified-linux-x64-online.run
@AJNOURI
AJNOURI / calc.py
Last active September 14, 2017 14:35
python script for mental math exercices
import random
import subprocess
def ab_biggerthan_ten():
# Generate 2 number sum of which <= 10
a = (random.randint(1,9))
rmin = 10-a
rmax = 9
b = (random.randint(rmin, rmax))
@AJNOURI
AJNOURI / calc.sh
Created August 15, 2017 16:53
Bash script for mental math exercices.
#!/bin/bash
TOTAL=0
HTOTAL=0
function generator(){
# $1: modulus
# $2: addrank
# $3: multrank
@AJNOURI
AJNOURI / video_download_pluralsight.js
Created June 17, 2017 11:59
Download Videos from PluralSights (Not stable)
http://paste.ofcode.org/xcviMeQdpupuiWC87GkT32
//Source:
//https://andrewramzyblog.wordpress.com/2016/04/25/how-to-get-a-free-full-plural-sight-subscription-download-courses-automatically-from-pluralsight/
//1
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
//2
@AJNOURI
AJNOURI / GNS3_install_Openstack_xenialvm.sh
Last active September 11, 2017 12:57
Script to install GNS3 on Xenial Openstack instance
#!/bin/bash
### Install GNS3
sudo add-apt-repository ppa:gns3/ppa
sudo apt-get update
sudp apt-get install -y python3-pip python-pip
### Install pyqt
pip3 install pyqt5
for log in $(ls /var/log/heat/); do tail /var/log/heat/$log;echo '###'; echo '###' ;done
2017-01-07 08:43:06.406 14763 WARNING oslo_config.cfg [-] Option "rpc_backend" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
2017-01-07 08:43:14.356 14763 INFO heat.api.cfn [-] Starting Heat API on 0.0.0.0:8000
2017-01-07 08:43:14.437 14763 WARNING oslo_reports.guru_meditation_report [-] Guru meditation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports.
2017-01-07 08:43:14.439 14763 INFO heat.common.wsgi [-] Starting single process server
2017-01-07 08:43:14.439 14763 INFO eventlet.wsgi.server [-] (14763) wsgi starting up on http://0.0.0.0:8000
###
###
2017-01-07 08:43:12.231 14865 WARNING oslo_config.cfg [-] Option "rpc_backend" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
@AJNOURI
AJNOURI / dhcp-static.ipxe
Created December 2, 2016 16:47
ipxe script to request dhcp otherwise static config (https://www.youtube.com/watch?v=RYbv8ZYAIl4)
#!ipxe
prompt --key 0x02 --timeout 10000 Press Ctrl-8 for iPXE command line... && shell || dhcp && goto netboot ||
ifclose
echo -n Choose net0 or net1 or ...: ${} && read nic
set ${nic}/dns 8.8.8.8
set ${nic}/netmask 255.255.255.0
config ${nic}
ifopen ${nic}
goto netboot
#!ipxe
dhcp
chain http://boot.ipxe.org/demo/boot.php
@AJNOURI
AJNOURI / backup.sh
Created November 2, 2016 03:59
Backup mongodb
#!/bin/bash
mongodump --out /backup/mongodb-$(date +"%d-%m-%Y-%H:%M:%S")
mongodump --out /backup/mongodb-latest
@AJNOURI
AJNOURI / restore.sh
Created November 2, 2016 03:58
Restore the latest mongodb or a particular one from the argument.
#!/bin/bash
if [ "$1" = "" ] ; then
mongorestore /backup/mongodb-latest/
else
mongorestore /backup/mongodb-$1/
fi