Skip to content

Instantly share code, notes, and snippets.

@JamesOBenson
JamesOBenson / clean-up-boot-partition-ubuntu.md
Last active April 8, 2021 16:32 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

TL;DR:

dpkg --list linux-{headers,image,modules,tools}-\* | awk '{ if ($1=="ii") print $2}' | grep -v -e "$(uname -r | cut -d"-" -f1,2)" | xargs sudo dpkg --remove  # use dpkg to remove all but the currently running kernel version
sudo apt-get install -f  # It's common for apt to be in a broken state after running out of space on /boot
sudo apt-get autoremove  # It's really common for apt to be broken on a package that should have been removed
sudo apt-get install -y linux-generic linux-headers-generic linux-image-generic linux-tools-generic  # just in case latest kernel was mysteriously removed (e.g. when you are not running the latest kernel)
sudo update-grub  # just in case it was not done automatically by dpkg
@JamesOBenson
JamesOBenson / beautiful_idiomatic_python.md
Created February 1, 2019 22:16 — forked from 0x4D31/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@JamesOBenson
JamesOBenson / greengrass_group_create.py
Created June 29, 2018 21:09 — forked from dzimine/greengrass_group_create.py
Create AWS Greengrass group and core.
import json
import yaml
import boto3
gg = boto3.client('greengrass')
iot = boto3.client('iot')
group = gg.create_group(Name="my_group")
keys_cert = iot.create_keys_and_certificate(setAsActive=True)
@JamesOBenson
JamesOBenson / README
Created September 14, 2017 04:18 — forked from xbb/README
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@JamesOBenson
JamesOBenson / README.md
Created November 30, 2016 22:04 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index: