Skip to content

Instantly share code, notes, and snippets.

View bitrut's full-sized avatar

Paweł Kowalski bitrut

View GitHub Profile

Looking to create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04?

Screen Shot 2020-06-05 at 20 55 31

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/install/storage) is outdated/wrong. And as of March 2021 it's possible that there's a bug as well with how the bios_grub partitions are created when using multiple disks.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage configuration step of the installer.
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.
@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active September 28, 2024 08:18
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@cocodrips
cocodrips / Sekai-ha-sjis-de-afureteru.py
Created July 30, 2015 02:49
Shift-JIS -> utf-8 in python
import sys
import codecs
if len(sys.argv) < 3:
exit(1)
with codecs.open(sys.argv[2], 'w', 'utf-8') as f:
for line in codecs.open(sys.argv[1], 'r', 'cp932'):
f.write(line)
@kwmiebach
kwmiebach / pytest.md
Last active August 30, 2024 07:44 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@paulirish
paulirish / bling.js
Last active August 27, 2024 04:55
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@staltz
staltz / introrx.md
Last active September 25, 2024 09:04
The introduction to Reactive Programming you've been missing
@teamon
teamon / gist:7678184
Last active December 29, 2015 13:39 — forked from bitrut/gist:7676303
db = {
person: {
save: function(obj){
if(obj.id){
return $http.post("/person", obj).then(function(res){
var data = angular.extend({}, obj); // create copy of `obj` + `id` field
data.id = res.data.id;
return data;
})
} else {
@avalanchy
avalanchy / gae_venv.md
Last active December 22, 2015 02:28
Google App Engine and Virtualenv (Python 2.7)

Lets download SDK to /tmp. I assume that Virtualenv is already installed.

  1. Unpack
unzip /tmp/google_appengine_<VERSION>.zip -d /usr/local
  1. Create Virtualenv
virtualenv ~/demo
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active September 25, 2024 09:03
A badass list of frontend development resources I collected over time.
@rolo
rolo / gist:1481128
Created December 15, 2011 13:44
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update