Skip to content

Instantly share code, notes, and snippets.

View fatihbaltaci's full-sized avatar

Fatih Baltaci fatihbaltaci

View GitHub Profile
@fatihbaltaci
fatihbaltaci / gist:20e2152e20302808c42c9a51b937df07
Created December 27, 2017 11:34 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@fatihbaltaci
fatihbaltaci / install_latex_with_editor_gummi.sh
Last active November 17, 2019 16:46
Install LaTeX with Gummi Editor on Ubuntu
#!/bin/bash
sudo apt install -y texlive-latex-extra texlive-science gummi
@fatihbaltaci
fatihbaltaci / slack_users_list_python.py
Created March 17, 2019 19:25
Get users information from Slack with Python 3
import requests
import json
TOKEN = "<YOUR_TOKEN>"
if __name__ == '__main__':
files_list_url = 'https://slack.com/api/users.list'
data = {"token": TOKEN}
response = requests.post(files_list_url, data=data)
@fatihbaltaci
fatihbaltaci / slack_files_delete_python.py
Created March 17, 2019 19:48
Deletes files from Slack with Python 3
import requests
TOKEN = "<YOUR_TOKEN>"
def delete(_response):
for f in _response.json()["files"]:
print("Deleting file " + f["name"] + "...")
delete_url = 'https://slack.com/api/files.delete'
res = requests.post(delete_url, data={
echo "deb http://repo.yandex.ru/yandex-disk/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/yandex-disk.list > /dev/null && wget http://repo.yandex.ru/yandex-disk/YANDEX-DISK-KEY.GPG -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install -y yandex-disk
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
#(Optional)
conda install pytorch=0.4.1 cuda90 -c pytorch
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run
chmod +x cuda_9.0.176_384.81_linux-run
./cuda_9.0.176_384.81_linux-run --extract=`pwd`
./cuda-linux.9.0.176-22781540.run
# First install CUDA https://gist.github.com/fatihbaltaci/e9ac5dde14e17c8b59c3ce4e90bcac0a
# Download (cuDNN Library for Linux) from https://developer.nvidia.com/rdp/cudnn-download
tar -xzvf cudnn-9.0-linux-x64-v7.5.0.56.tgz
#Default /usr/local/cuda
CUDA_HOME=<CUDA_PATH>
sudo cp cuda/include/cudnn.h $CUDA_HOME/include
import scipy.io
mat = scipy.io.loadmat('file.mat')