Skip to content

Instantly share code, notes, and snippets.

@runozo
runozo / clean_boot.sh
Last active October 9, 2019 09:15
Safely clean up ubuntu /boot partition
uname -r
sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`
sudo apt purge linux-image-3.19.0-25-generic
sudo apt autoremove -y
sudo update-grub
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.timeline-container {
display: flex;
flex-direction: column;
@runozo
runozo / Fix bad partitioning with LVM
Created March 1, 2017 09:13
Fix CloudatCost default partitioning
Disk identifier: 0x061e4152
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 20969471 20467714 9.8G 5 Extended
/dev/sda3 20969472 122879999 101910528 48.6G 83 Linux
/dev/sda5 501760 20969471 20467712 9.8G 8e Linux LVM
@runozo
runozo / LVM on Ubuntu howto
Last active August 8, 2022 21:06
Using LVM on Linux and resize swap partition
# RESCAN FOR NEWLY ADDED HDS
echo "- - -" > /sys/class/scsi_host/host#/scan
fdisk -l
# NEW LOGICAL VOLUME
sudo fdisk /dev/sdb
# then create a new partition of type 8e (Linux LVM)
# create a phisical volume
sudo pvcreate /dev/sdb1
# create new volume group
@runozo
runozo / vassal.ini
Created March 8, 2016 12:55
Config for a uwsgi vassal for Emperor mode
[uwsgi]
# Variabili
base = /srv/uwsgi_apps/%n
logbase = /var/log/uwsgi/apps
# Parametri per uwsgi
plugin = python3
pythonpath = %(base)
virtualenv = %(base)/env
@runozo
runozo / pull_all_git_repos.sh
Last active October 2, 2015 16:00
[bash] Pull all git repos in a directory
for p in *; do (cd $p; git pull);done
@runozo
runozo / pyvenv_nobug
Last active August 29, 2015 14:20
Create a Python3 virtual environment on Ubuntu 14.04 (fix bug https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847)
pyvenv-3.4 --without-pip env
source env/bin/activate
curl https://bootstrap.pypa.io/get-pip.py | python
deactivate
source env/bin/activate
@runozo
runozo / free_dev_resources
Last active August 29, 2015 14:19
Free Internet resources for developers
Url decoder/encoder: http://meyerweb.com/eric/tools/dencoder/
Free pictures:
* http://www.freepik.com/
* https://unsplash.com/
* http://dustn.tv/find-free-images/
@runozo
runozo / sublime_user_preferences.txt
Created March 31, 2015 12:03
My user config file for Sublime Text3 (Python oriented)
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
@runozo
runozo / install_oracle_jdk7.sh
Last active August 29, 2015 14:09
Install Oracle JDK 7 on Ubuntu 14.04 LTS
sudo apt-get install python-software-properties software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer