Skip to content

Instantly share code, notes, and snippets.

View alexalouit's full-sized avatar

Alexandre Alouit alexalouit

View GitHub Profile
@wolever
wolever / MIT-LICENSE.txt
Last active June 1, 2022 05:42 — forked from niw/MIT-LICENSE.txt
Put a mac's AirPort in HostAP mode. Updated to work with OS X 10.8.
Copyright (C) 2012 Yoshimasa Niwa
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@faisalman
faisalman / baseConverter.js
Last active January 11, 2023 14:43
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
@bitboxer
bitboxer / makeImage.sh
Created May 8, 2011 18:11
create a sparsebundle for mac os backups
#!/bin/bash
# A bash script to create a time machine disk image suitable for
# backups with OS X 10.6 (Snow Leopard)
# This script probably only works for me, so try it at your own peril!
# Use, distribute, and modify as you see fit but leave this header intact.
# (R) sunkid - September 5, 2009
#
# This will create a time machine ready disk image named with your
# computer's name with a maximum size of 600GB and copy it to
# /Volumes/backup. The image "file" (it's a directory, really) will
@koraykoska
koraykoska / run_long_process_in_background.rb
Created January 1, 2016 22:21 — forked from ChengLong/run_long_process_in_background.rb
Run Background Process in Sinatra
require 'sinatra'
get '/long_process' do
child_pid = Process.fork do
# hard work is done here...
sleep 10
Process.exit
end
@lyubenov
lyubenov / itebooks.py
Last active January 3, 2024 22:01
Removes it-ebooks.info links from book's footers. Run python itebooks.py -f /sourcepath/books/thebook.pdf to cleanup your thebook.pdf file.
#!/usr/bin/env python3
import sys
import re
import shutil
import argparse
import binascii
pattern = b'''0a2f54797065202f416e6e6f740a2f53756274797065202f4c696e6b0a2f52656
374205b20.*?205d0a2f426f7264657220.*?\n0a2f41203c3c0a2f54797065202f416374696f6e
@joemiller
joemiller / netpps.sh
Last active January 12, 2024 15:39
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@nazarsa
nazarsa / rabbitmq-send.py
Last active January 27, 2024 09:47
Send Message to Rabbit MQ Python Script
#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(
'localhost'))
channel = connection.channel()
channel.queue_declare(queue='queuename')
channel.basic_publish(exchange='',
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@Bat-Chat
Bat-Chat / overriding old tag
Created July 11, 2016 15:07
overriding old tag (move tag to latest commit)
Use the -f option to git tag:
-f
--force
Replace an existing tag with the given name (instead of failing)
You probably want to use -f in conjunction with -a to force-create an annotated tag instead of a non-annotated one.
Example
@anildigital
anildigital / cleanup_swap.md
Last active April 9, 2024 15:52
Cleanup swap space on macOS

To see current swap usage

sysctl -a | grep swap

Use only when when your system is in a very bad shape

$ sudo pkill -HUP -u _windowserver