Skip to content

Instantly share code, notes, and snippets.

View jmarhee's full-sized avatar

jmarhee

View GitHub Profile
@niepi
niepi / osx_php_homebrew.setup.md
Created February 28, 2012 13:23
OSX PHP Homebrew Setup

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna
@SimonGivre
SimonGivre / putIO-convert-to-MP4.js
Created August 30, 2012 09:47
put.io JS to convert into MP4 every file of folder
console.log($('.filelist .file-name .ftype:contains(video)').length + ' files to convert');
var cpt=0;
$('.filelist .file-name .ftype:contains(video)').each(function(){
var row = $(this).prev();
var id = row.attr('href').substring(row.attr('href').lastIndexOf('/')+1);
$.post('/v2/files/'+id+'/mp4',function(data){
console.log(data.status);
if(data.status=="OK") cpt++;
});
});
@ryanfitz
ryanfitz / golang-nuts.go
Created December 2, 2012 22:45
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl
@ryanrhanson
ryanrhanson / cancelsubnet.php
Created October 22, 2013 17:46
Cancel Subnet by IP
<?php
// Grab an IP address
$ip = readline("IP: ");
require_once dirname(__FILE__) . '/SoftLayer/SoapClient.class.php';
$apiUsername = 'set me';
$apiKey = 'set me too';
@L422Y
L422Y / osx_automount_nfs.md
Last active May 2, 2025 18:58
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@alces
alces / ansible_local_playbooks.md
Last active April 27, 2025 15:02
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@superseb
superseb / rke2-commands.md
Last active April 24, 2025 16:39
RKE2 commands

RKE2 commands

  • Updated on May 29 to accommodate etcd container not having /bin/sh available anymore.

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@antlionguard
antlionguard / twitter-remove-retweets.js
Last active April 7, 2025 11:19
With this script, you can remove all retweets you are retweeted on Twitter.
const timer = ms => new Promise(res => setTimeout(res, ms));
// Unretweet normally
const unretweetTweet = async (tweet) => {
await tweet.querySelector('[data-testid="unretweet"]').click();
await timer(250);
await document.querySelector('[data-testid="unretweetConfirm"]').click();
console.log('****// Unretweeted Successfully //****')
}
@astreknet
astreknet / OpenBSD_on_Apple_M2_QEMU.md
Last active October 25, 2024 21:27
OpenBSD on Apple M2 with QEMU

OpenBSD on Apple M2 with QEMU

Minimalist installation of OpenBSD on the Apple M2 using QEMU

Ingredients

Installation

  1. install QEMU with Homebrew brew install qemu, also possible with MacPorts
  2. Write a script with execute permissions chmod +x qemu_aarch64_install_openbsd.sh for installing the image.