Skip to content

Instantly share code, notes, and snippets.

View nickedes's full-sized avatar

Nikhil Mittal nickedes

  • Bangalore, India
View GitHub Profile
@nickedes
nickedes / rsa.py
Last active August 29, 2015 14:19 — forked from anonymous/rsa.py
import random
from itertools import count
# Extended Euclidean Algorithm
def egcd(a, b):
x,y, u,v = 0,1, 1,0
while a != 0:
q, r = b//a, b%a
m, n = x-u*q, y-v*q
b,a, x,y, u,v = a,r, u,v, m,n
@nickedes
nickedes / client.py
Created April 20, 2015 20:07
socket
# !/usr/bin/python # This is client.py file
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12345 # Reserve a port for your service.
s.connect((host, port))
#include <iostream>
using namespace std;
class base
{
int real,img;
public:
base ()
{
@nickedes
nickedes / email_server_setup.sh
Created April 29, 2015 19:01
Duffer-balam edition
#!/bin/bash
if [ $(id -u) != 0 ]
then
echo "\033[1;37;40mThis script must be run as root user . \nGo back and try again as root user\033[0m"
exit 1
fi
echo $(hostname)
echo '\033[1;37;40m Updating and installing packages \033[0m'
@nickedes
nickedes / run
Last active August 29, 2015 14:21
ftp,dhcp
#FTP
sudo apt-get install vsftpd
sudo service vsftpd start
ftp localhost
#Den receive data by get -> get filename
@nickedes
nickedes / Music.tree
Last active February 6, 2016 20:51
After seeing dufferzafar's Music tree,I created mine too.
.
|-- 100_Hits_Love_Happy_Valentines_Day
| |-- 001 Nat King Cole - Love.mp3
| |-- 002 Paul Anka - Diana (Remastered).mp3
| |-- 003 Shirley Bassey, Джордж Гершвин - S' Wonderfull (Remastered).mp3
| |-- 004 Frank Sinatra - Come Fly With Me.mp3
| |-- 005 Dean Martin - Volare (Remastered).mp3
| |-- 006 Elvis Presley - Lover Doll.mp3
| |-- 007 Carla Thomas - Gee Whiz, Look In His Eyes (Remastered).mp3
| |-- 008 Timi Yuro - Only You.mp3
@nickedes
nickedes / ball_on_line_gl.cpp
Last active August 29, 2015 14:27 — forked from dufferzafar/ball_on_line_gl.cpp
Control a ball on a line with Left & Right Keys using OpenGL
#define GLUT_DISABLE_ATEXIT_HACK
#include <windows.h>
#include <iostream>
#include <gl\glut.h>
// Initial Position of the Ball
float x_position = 0.0;
float y_position = 0.0;
// Radius of ball
@nickedes
nickedes / balls_gl.cpp
Last active August 29, 2015 14:27 — forked from dufferzafar/balls_gl.cpp
Ball Collisions with OpenGL. 1 -> 2 -> 1
#define GLUT_DISABLE_ATEXIT_HACK
#include <windows.h>
#include <gl\glut.h>
#include <iostream>
float x1=-2.0, x2=2.0;
static int flag=1;
static int i=0;
@nickedes
nickedes / cubes_gl.cpp
Last active August 29, 2015 14:27 — forked from dufferzafar/cubes_gl.cpp
Cube Zoom In - Zoom Out with OpenGL
#include <GL/glut.h>
static float zoom_factor = 0.5;
float ver[8][3] =
{
{-0.5 , -0.5 , 0.5} ,
{-0.5 , 0.5 , 0.5} ,
{0.5 , 0.5 , 0.5} ,
{0.5 , -0.5 , 0.5} ,
@nickedes
nickedes / Movie-list.tree
Created August 25, 2015 03:17
Movie Tree
.
|-- Seen
| |-- 300 Rise of an Empire (2014)
| | |-- 300.Rise.of.an.Empire.2014.1080p.BluRay.x264.YIFY.en.srt
| | |-- 300.Rise.of.an.Empire.2014.1080p.BluRay.x264.YIFY.mp4
| | |-- Thumbs.db
| | `-- WWW.YIFY-TORRENTS.COM.jpg
| |-- 500 Days Of Summer (2009)
| | |-- 500 Days Of Summer.2009.720p.BDRip.x264-VLiS.en.srt
| | |-- 500 Days Of Summer.2009.720p.BDRip.x264-VLiS.mp4