Skip to content

Instantly share code, notes, and snippets.

View zhouqt's full-sized avatar

Tom Zhou zhouqt

  • Canonical, Ltd.
  • Beijing, China
  • 00:10 (UTC +08:00)
View GitHub Profile
// ==UserScript==
// @name SFreadability-modified
// @namespace http://tampermonkey.net/
// @version 0.751
// @history 0.751 Merge from roylez's version
// @history 0.75 adjust comments section max-width
// @history 0.74 Hightlight last update date fields in case listings
// @history 0.73 Color code last updated time in case listing
// @history 0.721 Add functions to handle console page
// @history 0.72 Add call history tab 2020-03-06 (zhouqt)
// ==UserScript==
// @name SFComment
// @namespace http://tampermonkey.net/
// @version 0.11
// @description Workaround negative timecard caused by time drift
// @description Some SF comment window hacks
// @author roylez
// @include https://canonical*.visual.force.com/servlet/servlet.Integration*
// @license MIT
// @require https://code.jquery.com/jquery-2.2.4.min.js
#!/usr/bin/env python3
"""
This is a tool for recovering lost machine units in current model
Usage:
{0} model-name dest-dir
"""
# changes summary:
# added logic to prevent overwrite /var/lib/juju to avoid removing non-machine units
juju bootstrap --debug --config bootstrap-series=bionic --config agent-stream=devel localhost lxd-controller
juju add-model test
juju deploy cs:~openstack-charmers/ldap-test-fixture-4
unit="0"
ldap_ip=$(juju run --unit=ldap-test-fixture/${unit} 'unit-get private-address')
ldapsearch -h $ldap_ip -x -w crapper -D"cn=admin,dc=test,dc=com" -b dc=test,dc=com -s sub '(objectclass=*)' cn sn
juju ssh ldap-test-fixture/${unit}
sudo reboot

These instructions are based on this blogpost by Anton Semjonov and this video by Animortis Productions. Please follow the link if you want more details, they go into much more detail about each step, whereas this document is more focused on being a concise cheat sheet. Let's go.

Install base system

Boot the Ubuntu installation medium. When asked, choose the "Try Ubuntu" option and open a terminal.

Switch to root, otherwise you'll have to type sudo all the time:

sudo su -
@zhouqt
zhouqt / 00-maas-00-infiniband-c6100.sh
Created April 16, 2025 02:53 — forked from Banshee1221/00-maas-00-infiniband-c6100.sh
This script will update the Mellanox MT25408A0-FCC-QI (PSID: DEL09A0000009) and install OFED on Ubuntu 18.04
#!/bin/bash
# --- Start MAAS 1.0 script metadata ---
# name: Infiniband FW and SW prep
# parallel: instance
# may_reboot: True
# tags: infiniband
# type: commissioning
# for_hardware: pci:15B3:673C