**forked from luislavena's gist
UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released.
It requires manual installation, please see instructions below.
Hello,
#Verify the disk space on the machine and note the partition names. | |
df -h | |
#Using the partition name above, resize the disk | |
sudo resize2fs /dev/xvde1 | |
#Verify if the resizing was successful | |
df -h |
#Be on high alert while modifying this file. | |
#There should be no scope any error. | |
#Open the file | |
sudo visudo -f /etc/sudoers | |
#Add this line or modify the username for whom sudo command will not prompt for the password. | |
prash ALL=(ALL) NOPASSWD: ALL |
pscp -i some.ppk SSH_Client_Pub.pub root@10.23.12.17:/root/.ssh/ | |
ssh -i some.pem root@10.23.12.17 | |
ssh-keygen -f ~/.ssh/SSH_Client_Pub.pub -i >> ~/.ssh/authorized_keys | |
scp -i ~/.ssh/id_rsa -o "UserKnownHostsFile /dev/null" -o StrictHostKeyChecking=no -r SRC_FOLDER root@10.23.12.17:DEST_FOLDER |
Windows Registry Editor Version 5.00 | |
; | |
; Adds 'Atom' to context menu (when you right click) in Windows Explorer. | |
; | |
; Save this file to disk with a .reg extension. Replace C:\\Users\\<<winuser>>\\AppData\\Local\\atom\\app-0.165.0\\atom.exe with | |
; the path to the atom executable on your machine. I am on Atom 0.165.0 when I created this script. | |
; | |
; Please replace <<winuser>> with the user profile name on your Windows machine. | |
; This has been tested with Windows 7 64 bit. |
import java.time._ | |
import java.time.format.DateTimeFormatter | |
val date = "Sun Apr 03 05:40:58 +0200 2016" | |
val formatter = DateTimeFormatter.ofPattern("EE MMM dd HH:mm:ss ZZ yyyy") | |
val parsedDate = LocalDateTime.parse(date, formatter) | |
// parsedDate: java.time.LocalDateTime = 2016-04-03T05:40:58 | |
val parsedDateTZ = ZonedDateTime.parse(date, formatter) | |
// parsedDateTZ: java.time.ZonedDateTime = 2016-04-03T05:40:58+02:00 |
int[] arr = [-1, 3, 1, 5,3 ,2 ,1, 0, 7]; | |
int window = 3 | |
int len = arr.length; | |
for(int i = 0; i< len-window+1; i += 1) { | |
int[] newarr = new int[window]; | |
for(int j =0 ; j< window; j++){ | |
newarr[j] = arr[i+j]; | |
} | |
println(getMax(newarr)) |
sudo apt-get update | |
sudo apt-get install openssh-server | |
sudo apt-get install p7zip p7zip-full unzip python-pip python-dev | |
sudo apt-get install gfortran libopenblas-dev liblapack-dev | |
sudo pip install numpy | |
sudo pip install scipy |
**forked from luislavena's gist
UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released.
It requires manual installation, please see instructions below.
Hello,
# Not advisable. Do this ONLY if you understand what you are doing! | |
# This will terminate all your tmux or screen sessions, if you have any work yet to be saved, you will not be able to recover if you do this. | |
# Kill all the tmux sessions | |
tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill | |
# Kill all the detached screen sessions | |
screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill |
import os | |
# Current working directory where files and folders are present. | |
rootDir = os.getcwd() | |
# Destination directory to copy files. | |
destinationDir = 'D:/GBR/' | |
# Walk thru the directories in this root directory. | |
for dirName, subdirList, fileList in os.walk(rootDir): |