Skip to content

Instantly share code, notes, and snippets.

View Samnan's full-sized avatar
⚒️

Samnan ur Rehman Akhoond Samnan

⚒️
View GitHub Profile
@Samnan
Samnan / readme.md
Created April 4, 2022 09:08 — forked from darwin/readme.md
APFS Container cloning/replicating under Catalina (with a bootable system)

Today I wanted to move existing APFS-resident macOS Catalina installation to a new disk. I upgraded my late 2014 Mac Mini with a shiny new 1TB SSD. This took way too many hours of my life I will never get back. Hope this saves some time to you.

Good news:

  1. it is possible to create a DMG image from existing APFS container with macOS Catalina installation including metadata needed for complete restore (the DMG contains OS, OS Data, Preboot, Recovery and VM volumes)
  2. it is possible to restore this DMG image into empty APFS container and get a bootable copy of the original system

This information is relevant for Catalina (I'm currently running macOS 10.15.1).

@Samnan
Samnan / Has weird right-to-left characters.txt
Created December 27, 2020 17:19 — forked from endolith/Has weird right-to-left characters.txt
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@Samnan
Samnan / disable.sh
Created January 8, 2020 05:00
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@Samnan
Samnan / # php71 - 2018-01-05_12-52-42.txt
Created January 6, 2018 04:53
php71 (homebrew/php/php71) on macOS 10.12.5 - Homebrew build logs
Homebrew build logs for homebrew/php/php71 on macOS 10.12.5
Build date: 2018-01-05 12:52:42
@Samnan
Samnan / # php71 - 2017-10-05_19-14-17.txt
Created October 5, 2017 14:48
php71 (homebrew/php/php71) on macOS 10.12.5 - Homebrew build logs
Homebrew build logs for homebrew/php/php71 on macOS 10.12.5
Build date: 2017-10-05 19:14:17
@Samnan
Samnan / debug.md
Last active August 14, 2017 03:46
Debug info for atom beautify
// tooltip , i used in http://fbviralpictures.com/
(function(jQuery) {
jQuery.fn.k_tooltip = function(options) {
var defaults = {
use: 'title',
tooltipClass: 'tooltip'
};
var options = jQuery.extend(defaults, options),
@Samnan
Samnan / custom.php
Created June 2, 2012 05:15
Custom MyWebSQL auth driver for bangIDE
<?php
/**
* Custom MyWebSQL authentication driver for bangIDE
*
* @file: lib/auth/custom.php
* @author Samnan ur Rehman
* @copyright (c) 2008-2011 Samnan ur Rehman
* @web http://mywebsql.net
*/
@Samnan
Samnan / sample.html
Created July 1, 2011 07:01 — forked from kaichen/sample.html
html5 video sample w/ jquery.tmpl
<!doctype html>
<html>
<head>
<title>Html5 video with jq.tmpl sample</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
<script type="text/javascript">
$(document).ready(function () {