Skip to content

Instantly share code, notes, and snippets.

@plembo
plembo / czrocksdiskclone.md
Last active August 7, 2024 00:59
Clonezilla Rocks Ubuntu boot SSD to NVME

Cloning a Ubuntu boot SSD to NVME

Getting short of space on a 120G boot/root SSD on Ubuntu Server, decided to replace it with a bigger NVME (IDE) 250G drive.

Using the latest Clonezilla, the process was really painless. After cloning, there was still over 100G unallocated space on the larger drive for expansion of a new parition. The paritions of the clone had the same disk UUIDs and flags as the original.

  1. Checked disk and partition sizes using lsblk.
  2. Downloaded latest Stable iso from https://clonezilla.org/downloads.php.
  3. Get a 1G or more USB stick and burn the iso onto it using Startup Disk Creator.
  4. Installed the NVME drive onto the motherboard.
@dbrookman
dbrookman / build-mpv_silicon.sh
Last active September 25, 2024 08:13
How to build mpv & mpv.app on an Apple silicon Mac
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
@mytory
mytory / make-url-clickable-without-a-tag.php
Last active October 19, 2021 13:13
URL을 링크로 바꿔 주는데, 이미 링크가 걸린 a 태그는 건드리지 않는다.
<?php
/**
* 아래는 참고한 자료.
* @link https://stackoverflow.com/questions/24651869/regex-matching-links-without-a-tag/24653720?stw=2#24653720
*/
function make_link_clickable($text)
{
return preg_replace(
'!<a(.|\n)*?</a>(*SKIP)(*F)|' //skip a tag
. '(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;/=]+)!i',
@akihikodaki
akihikodaki / README.en.md
Last active September 7, 2024 13:11
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@gringoh
gringoh / android-emulator-reduce-cpu-usage.md
Last active September 22, 2024 11:39
[Android: Android emulator. Reduce CPU usage on MacOS] #android

Android emulator. Reduce CPU usage on MacOS

I wasn't able to shut the audio off with the config.ini file, but only with the -noaudio cmd line argument to qemu. However, with Android Studio 3.2, you can't add custom arguments to the emulator, so I made this:

In the emulator dir of the Android SDK, in my case ~/Android/Sdk/emulator/

mv emulator emulator.orig Make a bash script called emulator with the content:

#!/bin/bash
@wilsonpage
wilsonpage / swr.ts
Last active September 6, 2024 07:46
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
@geyang
geyang / iterm.bash
Created July 14, 2020 01:48
bash function for opening up iterm form current directory
#!/usr/bin/env bash
#
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open.
# TODO Add option to close iTerm2 after cmd execs
# See also https://www.iterm2.com/documentation-scripting.html
#
# Usage:
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@s3rj1k
s3rj1k / HowTo
Last active September 5, 2024 13:53
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
@tomhicks
tomhicks / plink-plonk.js
Last active July 26, 2024 01:10
Listen to your web pages