This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| modprobe iptable_nat | |
| echo 1 > /proc/sys/net/ipv4/ip_forward | |
| iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #Forward on this interface | |
| iptables -A FORWARD -i wlan0 -j ACCEPT #Tells to accept all connections coming on wlan0 | |
| # Works completely fine - Need to test it on OpenVPN | |
| # Here the interface which has internet is eth0 | |
| # Need to understand POSTROUTING nad MASQUERADE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from socket import * | |
| s=socket(AF_INET, SOCK_DGRAM) | |
| s.bind(('',12345)) | |
| m=s.recvfrom(1024) | |
| print m[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| This script is forked originally from Dave Jeffery. The original implementation | |
| was very slow and deleted around 2 tweets per second. Making it multithreaded I | |
| am able to delete 30-50 tweets per second. | |
| @author: vik-y | |
| ---------------------------------------------------------------------------- | |
| This script will delete all of the tweets in the specified account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # /etc/network/interfaces | |
| auto lo | |
| iface lo inet loopback | |
| iface eth0 inet dhcp | |
| #allow-hotplug wlan0 | |
| iface wlan0 inet manual | |
| wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * pc-lock.c | |
| * | |
| * Created on: Sep 24, 2015 | |
| * Author: Vikas Yadav (IMT2013060) | |
| * Producer Consumer Problem using lock variables | |
| * | |
| * NOTE: | |
| * | |
| * This solution works most of the time properly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Some info and links to help people understand what exactly is web development, what are its key elements and all | |
| you need to know to get started | |
| First of all what is a Server? | |
| http://whatis.techtarget.com/definition/server | |
| What is a Client-Server architecture? | |
| - It is one of the most prominent architectures used to design any software which interacts with web. Be it a website, | |
| a chat service or anything. | |
| https://en.wikipedia.org/wiki/Client%E2%80%93server_model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Reference http://stackoverflow.com/a/18490935/2037928 | |
| # Login as root | |
| # Install needed packages | |
| apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
| cd /tmp | |
| # Download appropriate ruby version https://www.ruby-lang.org/en/downloads/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # System + MySQL backup script | |
| # Copyright (c) 2008 Marchost | |
| # This script is licensed under GNU GPL version 2.0 or above | |
| # --------------------------------------------------------------------- | |
| # Taken from : https://www.howtoforge.com/shell-script-to-back-up-all-mysql-databases-each-table-in-an-individual-file-and-upload-to-remote-ftp | |
| ######################### | |
| ######TO BE MODIFIED##### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generating json | |
| import json | |
| from pprint import pprint | |
| data = {} | |
| data['key'] = ['value'] | |
| data['1']='bak' | |
| json_data = json.dumps(data) | |
| # Output: '{"1": "bak", "key": ["value"]}' |