Skip to content

Instantly share code, notes, and snippets.

@Sp1tF1r3
Sp1tF1r3 / mbr-to-gpt-uefi.md
Created July 4, 2022 20:06 — forked from cjyar/mbr-to-gpt-uefi.md
Convert a disk from MBR to GPT+UEFI, in Linux.

Before starting, make sure you have a backup, and make sure to have a linux live boot ready to rescue your system. It's easy to mess this up!

  1. Use gdisk to convert the partition table to GPT.

    gdisk /dev/sda

  2. Create the "BIOS boot" partition that GRUB needs.

    n to create a new partition. Needs to be about 1MB. You can probably squeeze this in from sectors 34-2047. Use L or l to look up the code for "BIOS boot" (ef02).

  3. Write the new partition table.

    w

  4. Reload the partition table. > partprobe /dev/sda
@Sp1tF1r3
Sp1tF1r3 / howto.txt
Created July 23, 2021 19:53 — forked from cemerson/howto.txt
SublimeText: PlainTasks HowTo
How to Use PlainTasks:
Projects:
☐ Anything with colon at the end of the line is a project title
☐ You can nest projects inside each other
☐ You can fold projects (a built-in editor feature)
Tasks:
You can write plain text as notes or descriptions wherever you want;
it's totally fine!
@Sp1tF1r3
Sp1tF1r3 / postgres-brew.md
Created August 15, 2020 11:52 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@Sp1tF1r3
Sp1tF1r3 / gist:299e7cefd8193fde1ebdf5e9c86dd27a
Created April 15, 2020 20:46 — forked from djpentz/gist:2482b5bf4b9682a7bb455dce5f1f79f8
Identifying hung transactions in MySQL
@Sp1tF1r3
Sp1tF1r3 / db_bind_sharding.py
Created October 6, 2017 21:16 — forked from ziplus4/db_bind_sharding.py
flask, sqlalchemy sample : sharding
# -*- coding:utf8 -*-
import re
from flask import Flask
from flask_sqlalchemy import SQLAlchemy as BaseSQLAlchemy
from flask_sqlalchemy import _SignallingSession as BaseSignallingSession
from flask_sqlalchemy import orm, partial, get_state
from datetime import datetime
@Sp1tF1r3
Sp1tF1r3 / verify_cert.py
Created September 29, 2017 20:13 — forked from cato-/verify_cert.py
Python script to check the status of ssl certificates
#!/usr/bin/env python
#
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <[email protected]> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
# ----------------------------------------------------------------------------
#
@Sp1tF1r3
Sp1tF1r3 / celeryd_rotate
Created June 23, 2017 14:31 — forked from winhamwr/celeryd_rotate
logrotate.d configuration for celery
/var/log/celery/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
copytruncate
}
BEGIN;
LOCK table_name;
ALTER TABLE table_name ADD COLUMN column_new column_type;
UPDATE table_name SET column_new = column_name;
ALTER TABLE table_name DROP column_name;
ALTER TABLE table_name RENAME column_new TO column_name;
END;
-- varchar -> integer
-- UPDATE cpvbeacon_dev SET column_new = CAST (nullif(column_name, '') AS INTEGER);