Skip to content

Instantly share code, notes, and snippets.

@JPalmerGithub
JPalmerGithub / iterm2-solarized.md
Created November 4, 2022 18:10 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@JPalmerGithub
JPalmerGithub / relocatelibvirtimages.md
Created November 3, 2022 12:08 — forked from plembo/relocatelibvirtimages.md
Relocate kvm images directory

Relocate an existing libvirtd (KVM) images directory

By default, KVM (libvirtd) images on Ubuntu and most other Linux distributions are found in /var/lib/libvirt/images. This can be inconvenient if you don't have a separate /var partition that can grow over time to accommodate multiple large images.

You can simply rename the images folder to something else and then symlink to a larger space with it (e.g. ln -s /data1/libvirt/images /var/lib/libvirt/images). That's what I used to do.

But that can lead to all sorts of unanticipated trouble. The right way to have your images on a bigger disk is to change the path for libvirt's default storage pool, which is logically where KVM is going to create them.

First check to make sure a default pool exists:

@JPalmerGithub
JPalmerGithub / createkvmstoragepool.md
Created November 3, 2022 12:07 — forked from plembo/createkvmstoragepool.md
Create the default KVM storage pool for images

Create the default KVM storage pool for images

Some distributions create the defaut KVM (libvirtd) storage pool for images when they install KVM, others do this upon the creation of the first KVM guest. Creating the default pool from scratch is pretty straightforward. Here's how to do it with virsh.

First verify there is no existing default pool:

$ virsh pool-list --all
 Name      State    Autostart
-----------------------------
@JPalmerGithub
JPalmerGithub / install.md
Created October 11, 2022 19:15 — forked from Ryanb58/install.md
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
# Simple SonarQube database and user creation for Postgresql
#
sudo -u postgres psql postgres
CREATE DATABASE sonar;
CREATE USER sonar WITH PASSWORD 'verysecret';
GRANT ALL PRIVILEGES ON DATABASE sonar TO sonar;
@JPalmerGithub
JPalmerGithub / pprint_color.py
Created January 25, 2022 12:21 — forked from EdwardBetts/pprint_color.py
Python pprint with color syntax highlighting for the console
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import Terminal256Formatter
from pprint import pformat
def pprint_color(obj):
print highlight(pformat(obj), PythonLexer(), Terminal256Formatter())
@JPalmerGithub
JPalmerGithub / createTable.py
Created January 24, 2022 17:30 — forked from svmotha/createTable.py
Check if DynamoDB table already exists and create one if it doesn't
import boto3
class tableCreate(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
# Query client and list_tables to see if table exists or not
def queryCreate(self):
# Instantiate your dynamo client object
client = boto3.client('dynamodb')
@JPalmerGithub
JPalmerGithub / tmMakeImage
Created December 31, 2021 15:30 — forked from chrisfcarroll/tmMakeImage
A commandline script for MacOS, to create a TimeMachine Backup Volume on a non-Apple formatted disk
#!/bin/bash
# 2015 Updates to sunkid's script. chrisfcarroll
# - added more quote marks to cope with e.g. spaces in volume names.
# - get machine UUID from ioreg instead of parsing and system report.
# - added steps to tell Time Machine to use your new backup drive.
# - renamed.
# Make it executable with e.g. chmod a+x tmMakeImage && mv tmMakeImage /usr/local/bin.
#
# A bash script to create a time machine disk image suitable for
# backups with OS X 10.6 (Snow Leopard) and later.
@JPalmerGithub
JPalmerGithub / assume.py
Created December 15, 2021 13:28 — forked from coingraham/assume.py
Python Boto3 Assume Role
import boto3
import sys
assume_role = sys.argv[1]
# create an STS client object that represents a live connection to the
# STS service
sts_client = boto3.client('sts')
# Call the assume_role method of the STSConnection object and pass the role