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/bash | |
# Run local bash script on remote server via SSH connection | |
# Login variables | |
USER="username" | |
HOST="host_address" #Remote host | |
PATH_TO_SCRIPT="path/to/your_script.sh" | |
ssh -l $USER $HOST 'bash -s' < $PATH_TO_SCRIPT |
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
# Solving Chinese Columnar Transposition Cipher | |
list_of_words = ['KLTNS AUEIA RDNHC', 'NABEK TYRBO', 'ENDTW YSILA', | |
'OJS BET SVE', 'RASRF EUQUO', 'TAB EGI SLL', 'KMNE SUOL', | |
'OONC DRAR LOII ANTS', 'IENIREA NTSETBL', 'OSAJAHM NKCLECI'] | |
def solve_chinese_cipher(cipher_text): | |
""" Given encrypted cipher_text, returns decrypted secret_message.""" | |
components = cipher_text.split(' ') |
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
#!upstart | |
description "ESS Server" | |
author "Aayush Sarva, <[email protected]>" | |
env DIRECTORY=/home/dev/electoralsearch_server/ | |
# Specify Runlevel events (Refer [1]) | |
# When to start the service | |
start on runlevel [2345] |
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
#include <stdio.h> | |
// Pattern (n = 4): | |
// 1*2*3*4*17*18*19*20 | |
// --5*6*7*14*15*16 | |
// ----8*9*12*13 | |
// ------10*11 | |
int calcOveralLastNum(int n) | |
{ |
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
"GCD - Greatest Common Divisor" | |
def gcd(a, b): | |
'''Returns GCD of 2 numbers.''' | |
if not b: | |
return a | |
else: | |
return gcd(b, a % b) | |
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
// Instructions: | |
// Compilation Command: gcc mainProgram.c myLibrary.c | |
// Creates required object files. | |
// Execution Command: ./a.out | |
#include <stdio.h> | |
// Including my library |
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
########## Default Values ######################### | |
# GitHub Repo URL (Both SSH and HTTPS work) | |
REPO_URL="<YOUR_REPO_URL>" | |
# GitHub branch | |
BRANCH="master" | |
# Docker Image Tag | |
TAG="latest" |
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
// Task using default Node.js packages | |
var http = require('http'); | |
var urls = ['http://screeningtest.vdocipher.com/file1.txt', | |
'http://screeningtest.vdocipher.com/file2.txt', | |
'http://screeningtest.vdocipher.com/file3.txt', | |
'http://screeningtest.vdocipher.com/file4.txt', | |
'http://screeningtest.vdocipher.com/file5.txt', | |
'http://screeningtest.vdocipher.com/file6.txt', |
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
""" | |
Project: Apartment Hunt | |
Get Address of properties on Magicbricks.com using Reverse-Geocoding | |
This script asks for the target property URL, reverse geocodes it | |
and prints the address of the property | |
Need: Magicbricks map functionality doesn't let users get directions. | |
Even the exact property address is not visible on the webpage. |
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 functools import wraps | |
import time | |
def timeit(func): | |
"""Decorator to calculate time taken by a function to run""" | |
@wraps(func) | |
def timed(*args, **kw): | |
start = time.time() | |
result = func(*args, **kw) |
OlderNewer