Skip to content

Instantly share code, notes, and snippets.

Always working from home

Haris ur Rehman hrehman200

Always working from home
View GitHub Profile
from random import shuffle
from os.path import isfile, join
from os import listdir
import os
import tweepy
import time
auth = tweepy.OAuthHandler('xxx', 'xxx')
auth.set_access_token('xxx', 'xxx')
hrehman200 /
Created Feb 26, 2018
Steps to mount large size (>2 TB) GPT formatted external hard drive on Linux
# Following command should list the 4 TB external hard drive. At the bottom you will see external hdd info and after that /dev/sdc or something like that:
sfdisk -l
# We need to create one partition of 4 TB so that it can be mounted. For this we need parted command with our external hdd parameter:
parted /dev/sdc
# you will enter into parted app. Enter mklabel to rewrite partition table of external drive i.e. /dev/sdc
(parted) mklabel gpt
# set unit to TB
hrehman200 / gist:887f3f9938f386b33bae63d53e282e87
Last active Nov 10, 2016
Flattens an arbitrary nested arrays of integers
View gist:887f3f9938f386b33bae63d53e282e87
* Flattens an arbitrary nested arrays of integers
* e.g. [[1,2,[3]],4] -> [1,2,3,4]
* @param arr The input array
* @param responseArr The output array we will be filling via recursion
* @returns {Array} The flattened array
function flattenArray(arr, responseArr) {
You can’t perform that action at this time.