Skip to content

Instantly share code, notes, and snippets.

@ammgws
ammgws / proxmox_CT_distupgrade_fix.md
Last active November 16, 2023 14:54
Fix for Proxmox container failing to start after dist-upgrade
  • Upgraded from Ubuntu 16.04 LTS to 18.04 (pre-release) using dist-upgade
  • Upon restart CT would not start
  • Error displayed in Web GUI: command 'systemctl start pve-container@101' failed: exit code 1
  • SSHd in and manually ran CT with pct start 101:
>root@server:~# pct start 101
Job for pve-container@101.service failed because the control process exited with error code.
See "systemctl status pve-container@101.service" and "journalctl -xe" for details.
command 'systemctl start pve-container@101' failed: exit code 1
@ammgws
ammgws / unifi_ubuntu_lxc_install.md
Last active January 23, 2019 11:15
Steps to install Unifi 5.6.29 in a Ubuntu 16.04 unpriveleged LXC
@ammgws
ammgws / edgerouter_lite_openvpn.md
Last active April 16, 2023 05:04
Notes on setting up OpenVPN on Edgerouter Lite

My notes on how I setup OpenVPN server on Edgerouter Lite. Based mostly on this guide from openVPN wiki. This guide assumes easyrsa3 is being used, otherwise substitute whatever the easyrsa2 versions are for the commands below.

This guide will use 3 different machines.

A Public Key Infrastructure (PKI) will be created on each machine:

    1. Server - openVPN server (Edgerouter in this case).
    1. Client(s) - the device(s) you will be connecting from.
    1. CA Server - used to generate and sign certificates for server and clients to use.
@ammgws
ammgws / alx_wol.md
Created July 23, 2017 16:32
re-enable WOL for atheros (alx) driver

Use the script from here.

automatic dkms module installer for patched alx

This is a quick and dirty setup that will automatically setup the dkms module for your specific kernel version.
This will only work on debian/ubuntu and other derivates and requires dkms and patch to be setup already.

The setup uses sudo and thus you are asked for your password once.
It will then attempt to download your kernels source, copy and patch the alx related files and place a "alx-" in your /usr/src directory, enable and compile the module and finally rebuild your initrd.
Currently the the very first compilation somehow fails, thats why it's run twice.

@ammgws
ammgws / htpc_setup_notes.md
Last active January 19, 2018 13:53
Notes on how I setup HTPC for future reference

1. Preparation / OS Install

  • Create liveusb using Ubuntu mini.iso dd bs=4M if=/home/user/Downloads/mini.iso of=/dev/sdf status=progress; and sync in fish shell

  • During install will be prompted for what to install: choose xubuntu minimal and openssh server

  • This time left just one disk (8TB) in the case, and used LVM when partitioning: root given 15gb, data partition given the rest (set recovery-blocks to 1% and inode to largest size since this is just a media partition)

2. Creating a user with limited privileges for Kodi

Setup PGP

~/.gnupg/gpg.conf use SHA512 over default SHA256

personal-digest-preferences SHA512
cert-digest-algo SHA512
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
personal-cipher-preferences TWOFISH CAMELLIA256 AES 3DES
@hmanicka
hmanicka / app.py
Last active April 30, 2021 15:22
Flask-Admin: To update timestamp with timezone field with UTC
import pytz
class MyView(MyModelView):
# Display the time in user's local timezone on the List View
column_formatters =
dict(scheduledtime=lambda v,c,m,p: m.scheduledtime.replace(tzinfo=pytz.utc).astimezone(tz=pytz.timezone(config.LOCAL_TIMEZONE)))
# Display the time in user's timezone on the Edit View
def edit_form(self, obj):
form = self._edit_form_class(get_form_data(), obj=obj)
@czardoz
czardoz / background_flask.py
Created April 21, 2015 10:45
Simple Flask app with a background task using gevent
import gevent
import gevent.monkey
gevent.monkey.patch_all()
from gevent.pywsgi import WSGIServer
from flask import Flask
app = Flask(__name__)
app.debug = True
@theskumar
theskumar / app.py
Created November 17, 2014 06:47
Database diagram using sqlalchemy
# -*- coding: utf-8 -*-
''' Generates database schema graph from a relational database.
Usages:
Add database configuation in this file and then
python app.py
Note: You must have your latest database schema in the database
engine you are running against.
'''
from __future__ import unicode_literals, absolute_import
@h4cc
h4cc / howto.md
Last active November 28, 2022 12:53
Getting Thumbnails / Previews of your RAW files in Ubuntu

Howto

Install these programms

sudo apt-get install gnome-raw-thumbnailer ufraw-batch

Try now if everything works, and your thumbnails show up. If not, try the following part.