Skip to content

Instantly share code, notes, and snippets.

View qorbani's full-sized avatar

Reza Qorbani qorbani

View GitHub Profile
@mmornati
mmornati / default.yaml
Last active December 28, 2021 03:51
default.yaml
# ===================================================================== #
# BASIC CONFIGURATION
# ===================================================================== #
# Arch: "default", "x86_64", "aarch64".
# "default" corresponds to the host architecture.
arch: "default"
# An image must support systemd and cloud-init.
# Ubuntu and Fedora are known to work.
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active November 15, 2024 11:57
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@mayneyao
mayneyao / notion2blog.js
Last active September 14, 2024 01:22
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@magnetikonline
magnetikonline / mysqlslavecheck.sh
Last active December 9, 2021 15:34
Example bash script for a PRTG SSH script sensor - this one for MySQL slave to master checks.
#!/bin/bash
# query MySQL for slave replication status
# note: requires [~/.my.cnf] to be present a populated with valid MySQL password
mysql \
--batch \
--user root \
--execute "SHOW GLOBAL STATUS LIKE 'Slave_running';" | \
tail --lines 1 | grep --extended-regexp --quiet "^Slave_running\tON$"
@demisx
demisx / gulpfile.js
Last active July 14, 2022 16:06
Gulp 4 gulpfile.js
// Gulp 4
var gulp = require('gulp');
var using = require('gulp-using');
var grep = require('gulp-grep');
var changed = require('gulp-changed');
var del = require('del');
var coffee = require('gulp-coffee');
var less = require('gulp-less');
var coffeelint = require('gulp-coffeelint');
var sourcemaps = require('gulp-sourcemaps');
@fprimex
fprimex / set_alert_limits.sh
Created April 28, 2014 11:08
Couchbase set_alert_limits.sh
#!/bin/sh
cbuser=Administrator
cbpassword=couchbase
cbserver=127.0.0.1
cbport=8091
# default is 50
max_overhead_perc=50
# default is 90
@nickbudi
nickbudi / README.md
Last active July 1, 2024 11:14
Get Finder to sort like Windows Explorer a la terminal

Get Finder to sort folders first like Windows Explorer a la terminal.

Note: This hack is no longer needed in High Sierra. Just run defaults write com.apple.finder _FXSortFoldersFirst -bool true

Results

Results Two things to note:

  • Unfortunately files are sorted by kind first then alphabetically. Check the location of bootstrap.sh in the screenshot for example. This is as close as I could get it to Windows Explorer for now.
  • I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders with ease, we'll see.
@mikaelbr
mikaelbr / gulpfile.js
Created January 14, 2014 20:24
Example gulpfile for complete set-up.
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var less = require('gulp-less');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var minifyCSS = require('gulp-minify-css');
var embedlr = require('gulp-embedlr');