Skip to content

Instantly share code, notes, and snippets.

View TheNoim's full-sized avatar
🏠
Working from home

Nils Bergmann TheNoim

🏠
Working from home
View GitHub Profile
@marek-saji
marek-saji / JSON.safe.js
Created January 17, 2013 09:49
Safe version of JSON.stringify. Discards functions, detects multiple references to same objects and introduces maximum depth.
function safeJSONStringify (input, maxDepth)
{
var output,
refs = [],
refsPaths = [];
maxDepth = maxDepth || 5;
function recursion (input, path, depth)
@jpalala
jpalala / how-to-setup-mac-elasticsearch.md
Created September 11, 2015 08:28
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

@dunklesToast
dunklesToast / README.md
Last active May 14, 2022 13:29
Dell R710 Scripts for changing fan speed

Dell PowerEdge R710 Fan Control

start the script like this:

./setTo2160.sh idrac ip idrac user - you will be prompted for the password!

./resetToNormal.sh idrac ip idrac user you will be prompted for the password!

@nijikokun
nijikokun / bench-execution.md
Last active March 12, 2023 12:24
Benchmark single method execution time easily using Node.js or Javascript in general.

So, I was developing a node shell script and wanted to determine the time it took from start, to finish to generate the output of a file. Simple, right? It is, but the problem is that if you want a clean way to do it... you have to develop it, otherwise you'll have a lot of wrapper code surrounding methods and such. So I wrote a small method to simplify it even further.

Benchmark Method:

function benchmark (method) {
  var start = +(new Date);

  method && method(function (callback) {
 var end = +(new Date);
@kennwhite
kennwhite / reset_osx_attributes.sh
Created September 1, 2013 03:10
Remove all extended attributes recursively on an OSX directory & files and fix "chown: ... Operation not permitted" and "chmod: ... Operation not permitted"
# This is the nuclear option. Use with extreme care
# Works up to and including Mountain Lion (10.8.x)
# Show all extended attributes
ls -lOe ~/dir-to-fix
# Remove no-change attributes
sudo chflags nouchg ~/dir-to-fix
# Recursively clear all entended attributes
@fragtion
fragtion / fanspeeds.sh
Last active August 2, 2023 18:40
Dell R610 / R710 temperature-based fan speeds script
#!/bin/bash
# ----------------------------------------------------------------------------------
# Script for checking the temperature reported by the ambient temperature sensor,
# and if deemed too high send the raw IPMI command to enable dynamic fan control.
#
# Also get CPU temps from lm-sensors and adjust fan speeds according to defined
# speed % which should be set according to your needs (each CPU model will vary)
#
# Requires:
@insidegui
insidegui / devicectl.sh
Created October 19, 2023 21:58
Helper functions for using devicectl to kill processes on connected iOS devices
# Add to your zsh profile
function devicepid() {
if [ -z "$1" ]; then
echo "Usage: devicepid <device-name> <search>"
echo "Example: devicepid 'iPhone 15 Pro Max' SpringBoard"
return 1
fi
if [ -z "$2" ]; then
@kekru
kekru / Remote API via daemon.json.md
Last active January 11, 2024 18:20
Enable Docker Remote API via daemon.json
@Obbut
Obbut / Adding a Physical Disk to Parallels.md
Last active January 23, 2024 08:06
Adding a second physical disk to Parallels

Adding a second physical disk to Parallels Desktop 14

I wanted my (NTFS) data disk to be accessible from my boot camp Parallels VM. Parallels provides no support for this, so I tried it myself.

I duplicated the disk file that Parallels created and started poking around, and after half an hour or so, had success. This is what you need to do.

My boot camp disk is at /dev/disk0. My data disk is at /dev/disk1.

These instructions are provided for educational use only and without guarantees. If you lose data because of this, blame yourself, and only follow them if you know what you are doing.

@t3easy
t3easy / .gitlab-ci.yml
Last active February 12, 2024 18:05
Build and deploy docker containers with GitLab CI
image: an-image-with-docker-and-docker-compose
variables:
DOCKER_TLS_VERIFY: "1"
DOCKER_CERT_PATH: ".docker"
before_script:
- mkdir -p $DOCKER_CERT_PATH
- echo "$DOCKER_CA" > $DOCKER_CERT_PATH/ca.pem
- echo "$DOCKER_CERT" > $DOCKER_CERT_PATH/cert.pem