Skip to content

Instantly share code, notes, and snippets.

View ilya-lysko's full-sized avatar
🎯
Focusing

Ilya Lysko ilya-lysko

🎯
Focusing
View GitHub Profile
# turn on
sudo pmset -a sleep 0
sudo pmset -a hibernatemode 0
sudo pmset -a disablesleep 1
# turn off
sudo pmset -a sleep 1
sudo pmset -a hibernatemode 3
sudo pmset -a disablesleep 0
@ilya-lysko
ilya-lysko / docker_remove_none_images.sh
Created October 18, 2020 16:03
[Remove <none> docker images] #docker
docker images | grep '<none>' | awk '{print $3}' | \
while read f
do
docker image rm ${f} ; echo ${f}
done
@ilya-lysko
ilya-lysko / reload_modules.py
Last active October 27, 2020 13:05
[Ext to autoreload modules in jupyter] Extension to autoreload modules before executing code #jupyter
%load_ext autoreload
%autoreload 2
@ilya-lysko
ilya-lysko / hdfs_check_dir_sizes.sh
Last active March 20, 2021 10:18
[Check all directories sizes in path] #hadoop
hdfs dfs -ls $YOUR_PATH | awk '{print $8}' | while read f; do hdfs dfs -du -s -h $f; done
@ilya-lysko
ilya-lysko / timer.sh
Created November 7, 2019 16:58
[Run command after time]
sleep 60m && ls
@ilya-lysko
ilya-lysko / xgboost_feature_names.py
Last active July 23, 2019 14:27
[Get feature names from fitted xgboost model]
xgb_model.get_booster().feature_names
@ilya-lysko
ilya-lysko / char_limit
Created July 23, 2019 12:49
[*nix terminal stdin chars limit]
4095
@ilya-lysko
ilya-lysko / send_mail.sh
Created July 23, 2019 12:48
[Send mail from bash]
echo "Body" | mailx -r "FROM_EMAIL" -s "SUBJECT" "To_EMAIL"
@ilya-lysko
ilya-lysko / random_sample.sh
Last active November 8, 2019 15:55
[Random sample from file using bash]
shuf -n <sample length> <distr_file> > <sample_file>
@ilya-lysko
ilya-lysko / unpack_tar.sh
Last active December 14, 2019 12:08
[Unpack tar.gz archive] Nobody remember it :)
tar -xvzf archive.tar.gz