Skip to content

Instantly share code, notes, and snippets.

View bastibeckr's full-sized avatar

Basti Becker bastibeckr

  • studio2010 GmbH
  • Munich, Germany
  • 06:15 (UTC +02:00)
View GitHub Profile
@yesdevnull
yesdevnull / Users.csv
Last active May 15, 2022 03:20
Use this script to import users into an Open Directory domain on OS X Mavericks Server with users in a CSV. The Users.csv file is an example file to show you the structure expected.
Joe Smith 123456 147852
Bill Jones 987654 369852
Steve Miller 654321 852147
@GeorgeDewar
GeorgeDewar / gist:11171561
Created April 22, 2014 09:21
Checksum calculation example for IR codes of a Fujitsu heat pump (remote AR-RAH1E)
# Sample data
data = []
data[0] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101100000001000000000000000 00000000000000000000010001111111'
data[1] = '00101000110001100000000000001000 00001000011111111001000000001100 00000011100000001000000000000000 00000000000000000000010001110111'
data[2] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101100011001000000000000000 00001011111110010000010011111010'
data[3] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101100000001000100000000000 00000000000000000000010001110111'
data[4] = '00101000110001100000000000001000 00001000011111111001000000001100 00001101000000000000100000000000 00000000000000000000010000001111'
# Checksum function
@ricardo-rossi
ricardo-rossi / ElasticSearch.sh
Last active February 25, 2025 22:09
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@amatiasq
amatiasq / throttle-promise.js
Last active November 16, 2018 16:20
This function will prevent a long operation to be executed twice in parallel. If the function is invoked a second time before the first time has completed it will receive the same promise from the first invocation without need to invoke the operation again.
function throttlePromise(operation) {
var promise = null;
return function() {
if (!promise) {
promise = operation.apply(this, arguments).finally(function() {
promise = null;
});
}
@tracker1
tracker1 / 01-directory-structure.md
Last active May 3, 2025 04:36
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@drkarl
drkarl / gist:739a864b3275e901d317
Last active April 29, 2025 20:18
Ask HN: Best Linux server backup system?

Linux Backup Solutions

I've been looking for the best Linux backup system, and also reading lots of HN comments.

Instead of putting pros and cons of every backup system I'll just list some deal-breakers which would disqualify them.

Also I would like that you, the HN community, would add more deal breakers for these or other backup systems if you know some more and at the same time, if you have data to disprove some of the deal-breakers listed here (benchmarks, info about something being true for older releases but is fixed on newer releases), please share it so that I can edit this list accordingly.

  • It has a lot of management overhead and that's a problem if you don't have time for a full time backup administrator.
@toddtreece
toddtreece / midi_cv.ino
Created April 28, 2015 02:33
FifteenStep: MIDI in -> CV Out
// ---------------------------------------------------------------------------
//
// midi_cv.ino
//
// A MIDI sequencer example using two MCP4725 dacs for eurorack control voltage
// output and NeoPixels for display.
//
// Required dependencies:
// Adafruit FifteenStep Sequencer Library: https://github.com/adafruit/FifteenStep
// Adafruit NeoPixel Library: https://github.com/adafruit/Adafruit_NeoPixel
@pmbuko
pmbuko / ad_pass_exp.sh
Last active November 27, 2017 21:27
These are the shell commands that ADPassMon uses internally to get the information it needs.
#!/bin/bash
myDomain=$(dsconfigad -show | awk '/Active Directory Domain/{print $NF}')
myLDAP=$(dig -t srv _ldap._tcp.${myDomain} | awk '/^_ldap/{print $NF}' | head -1)
mySearchBase=$(ldapsearch -LLL -Q -s base -H ldap://${myLDAP} defaultNamingContext | awk '/defaultNamingContext/{print $2}')
uAC=$(dscl localhost read /Search/Users/$USER userAccountControl | awk '/:userAccountControl:/{print $2}')
if [[ $uAC =~ ^6 ]]; then
@jjnilton
jjnilton / mac-network-commands-cheat-sheet.md
Last active May 30, 2025 04:11
Mac Network Commands Cheat Sheet

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

The original author seems to be Charles Edge, here's the original content, as pointed out by @percisely.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and s

@soderlind
soderlind / dropzonejs-wp-rest-api-custom-endpoint.js
Created February 1, 2016 19:33
DropzoneJS & WordPress REST API with Custom Endpoint
// dropzoneWordpressRestApiForm is the configuration for the element that has an id attribute
// with the value dropzone-wordpress-rest-api-form (or dropzoneWordpressRestApiForm)
Dropzone.options.dropzoneWordpressRestApiForm = {
//acceptedFiles: "image/*", // all image mime types
acceptedFiles: ".jpg", // only .jpg files
maxFiles: 1,
uploadMultiple: false,
maxFilesize: 5, // 5 MB
init: function() {
console.group('dropzonejs-wp-rest-api:');