Skip to content

Instantly share code, notes, and snippets.

@b0gdanw
b0gdanw / DisableBigSur.sh
Last active March 29, 2024 09:50
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
@bluewalk
bluewalk / GetNordVPNWireGuardDetails.md
Last active March 29, 2024 09:48
Getting NordVPN WireGuard details

About

Instructions to obtain WireGuard details of your NordVPN account. These can be used to setup a WireGuard tunnel on your router to NordVPN.

Source: https://forum.gl-inet.com/t/configure-wireguard-client-to-connect-to-nordvpn-servers/10422/27

Prerequisites

If you have any linux machine, use that or install a vm if you don't have one.

Get their official linux app installed. Make sure you have wireguard installed too. And set the used technology to Nordlynx by running nordvpn set technology nordlynx

@sirkonst
sirkonst / docker-prune.service
Created November 22, 2018 12:25
Remove unused docker resources with systemd (service and timer)
[Unit]
Description=Remove unused docker resources
Documentation=https://docs.docker.com/v17.09/engine/admin/pruning/
After=docker.service
[Service]
Type=oneshot
ExecStart=/usr/bin/docker system prune -f --filter "until=744h"
ExecStart=/usr/bin/docker volume prune -f
@tanaikech
tanaikech / submit.md
Last active March 29, 2024 09:47
Simple Script of Resumable Upload with Google Drive API for Python

Simple Script of Resumable Upload with Google Drive API for Python

This is a simple sample script for achieving the resumable upload to Google Drive using Python. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.

In this sample, a PNG file is uploaded with the resumable upload using a single chunk.

Sample script

Before you use this, please set the variables.

@a7ul
a7ul / jamf.md
Last active March 29, 2024 09:47
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@todgru
todgru / elasticsearch-setup-apple-macbook-pro-m1.md
Created February 9, 2023 23:52
Install Elasticsearch 7.x on Apple Macbook Pro M1 Ventura 13.2

Elasticsearch Setup Apple MacBook Pro M1

Apple MacBook Pro M1, 32 GB, Ventura 13.2

Documentation based on comments in this Github Elasticsearch issue.

Install Homebrew

// To compile this program, you need to install:
// sudo apt-get install libbluetooth-dev
// Then you can compile it with:
// cc scanner.c -lbluetooth -o scanner
// You can then run it with:
// ./scanner
// Copyright (c) 2021 David G. Young
// Copyright (c) 2015 Damian Kołakowski. All rights reserved.
// License: BSD 3. See: https://github.com/davidgyoung/ble-scanner
@paulirish
paulirish / what-forces-layout.md
Last active March 29, 2024 09:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@leerob
leerob / settings.json
Created January 8, 2023 17:15
VSCode settings (2023)
{
// NORMAL SETTINGS
// ===============
"editor.quickSuggestions": {
"comments": "on",
"strings": "on",
"other": "on"
},
"editor.suggestOnTriggerCharacters": true,
"editor.wordBasedSuggestions": true,
@dkexception
dkexception / SetSystemBarColors.kt
Created March 21, 2024 05:58
A reusable method to set the System Bar colors in association with enableEdgeToEdge API
import android.graphics.Color
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
/**
* Sets the relevant foreground color to the system bars i.e. Status & Navigation bars