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 / 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'
#include <iostream>
using namespace std;
class base
{
int real,img;
public:
base ()
{
@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))
@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 / call-steps
Last active September 15, 2015 17:27
Download 3.14.37.tar.xz
STEP 1:
cd Downloads/
sudo tar -xvJf linux-3.14.37.tar.xz -C /usr/src/
cd /usr/src/linux-3.14.37/
sudo mkdir hello
cd hello/
sudo gedit hello.c #given below
@nickedes
nickedes / client.py
Last active August 29, 2015 14:17 — forked from dufferzafar/client.py
import sys
from socket import socket, AF_INET, SOCK_DGRAM
SERVER_IP = '127.0.0.1'
PORT_NUMBER = 5000
SIZE = 1024
print("Test client sending packets to IP {0}, via port {1}\n".format(SERVER_IP, PORT_NUMBER))
mySocket = socket(AF_INET, SOCK_DGRAM)
➜ apertium ./autogen.sh 
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:53: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:53: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
apertium/Makefile.am:164: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
@nickedes
nickedes / python-pip3-log.md
Last active August 29, 2015 14:15
Error in pip3
nickedes@nickedes ~> sudo apt-get purge python-setuptools python3-setuptools python-pip python3-pip
[sudo] password for nickedes: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'python-pip' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  gir1.2-nemo-3.0 libboost-python1.54.0 libcryptui0a libgtksourceview2.0-0
  libgtksourceview2.0-common libjs-jquery libjs-sphinxdoc libjs-underscore