Skip to content

Instantly share code, notes, and snippets.

View romach's full-sized avatar

Roman Cherepanov romach

View GitHub Profile
@romach
romach / ssd-health-check.sh
Last active August 7, 2019 17:38
How to check out SSD disk health in Ubuntu
# Install **Gnome Disk Utility**
sudo apt-get install gnome-disk-utility
# Start via command:
gnome-disks
# Then select in menu 'SMART Data & Self-Tests' or use `Ctrl+S` shortcut.
@romach
romach / jekyll-command-not-found.sh
Last active April 2, 2017 16:59
Resolve problem: `bash: jekyll: command not found`
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bashrc
source ~/.bashrc
@romach
romach / fix-shortcuts.sh
Last active April 2, 2017 16:58
Fix English shortcuts with non-English layout in Ubuntu 16.04
sudo add-apt-repository ppa:attente/java-non-latin-shortcuts
sudo apt-get update
sudo apt-get dist-upgrade
restart unity-settings-daemon
@romach
romach / remove-unused-docker-data.sh
Last active October 5, 2017 14:34
Remove unused Docker data
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker volume rm $(docker volume ls -qf dangling=true)
@romach
romach / find-largest-files-and-directories.sh
Last active April 2, 2017 16:56
Find largest files and directories
sudo du -a / | sort -n -r | head -n 50
@romach
romach / access-to-environment-variable.py
Last active April 2, 2017 16:55
Access to environment variable
import os
print os.environ['HOME']
@romach
romach / list-files-in-folder.py
Last active April 13, 2017 21:01
List files in folder
for file in listdir('/home/romach/Projects/javaman-jekyll-ru/_drafts'):
print file
files = [f for f in listdir(mypath) if isfile(join(mypath, f))]
@romach
romach / extract-extension-from-filename.py
Last active April 2, 2017 19:55
Extract extension from filename
import os
filename = os.path.splitext('/path/to/somefile.ext')[0]
@romach
romach / enable-python-in-intellij-idea
Last active April 2, 2017 17:28
Enable Python in Intellij IDEA
File -> Project Structure -> Project -> Project SDK -> new
select the installation path of your Python interpreter
@romach
romach / check-variable-not-null.py
Created April 2, 2017 17:43
Check variable not null
if not (val is None):
# ...