Skip to content

Instantly share code, notes, and snippets.

View bbigras's full-sized avatar

Bruno Bigras bbigras

  • Laval, Québec
  • 09:23 (UTC -04:00)
View GitHub Profile
@szook
szook / gist:4d56573ff7529cfeaf7c0b67f9b85902
Last active June 17, 2021 12:36
Grafana prometheus dashboard for MS SQL Server based on wmi_exporter metrics
{
"annotations": {
"list": [
{
"$$hashKey": "object:690",
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@sunnyone
sunnyone / hello-u8.rs
Last active September 20, 2021 10:13
Windows Unicode conversion in Rust
// Add to Cargo.toml
// [dependencies]
// winapi = "*"
// user32-sys = "*"
extern crate winapi;
extern crate user32;
fn from_wide_ptr(ptr: *const u16) -> String {
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
@shamil
shamil / mount_qcow2.md
Last active April 25, 2024 09:25
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@bryfry
bryfry / gzip.go
Last active August 28, 2023 09:23
Idiomatic golang net/http gzip transparent compression (works with Alice)
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
// Gzip Compression
@c4milo
c4milo / ejabberd.conf
Created May 18, 2014 18:47
Upstart script for Ejabberd
# Ubuntu upstart file at /etc/init/ejabberd.conf
respawn
respawn limit 20 5
start on runlevel [2345]
stop on runlevel [06]
script
exec start-stop-daemon --start --name ejabberd --user ejabberd --chuid ejabberd --exec /usr/local/sbin/ejabberdctl -- start
@turtlemonvh
turtlemonvh / main.js
Last active January 3, 2021 16:37
Angular Messaging
var MyApp = angular.module('MyApp');
MyApp.factory('msgBus', ['$rootScope', function($rootScope) {
var msgBus = {};
msgBus.emitMsg = function(msg, data) {
data = data || {};
$rootScope.$emit(msg, data);
};
msgBus.onMsg = function(msg, func, scope) {
var unbind = $rootScope.$on(msg, func);
if (scope) {
@schnell18
schnell18 / gitolite_cgit_ldap_nginx_integration.txt
Last active June 12, 2019 02:50
working nginx config to integrate Gitolite, cgit and LDAP.
ldap_server auth1 {
url "ldap://vmcentos64:389/ou=Users,ou=Accounts,dc=acme,dc=com?cn?sub?(objectClass=*)";
binddn "cn=manager,dc=acme,dc=com";
binddn_passwd password;
group_attribute cn;
group_attribute_is_dn on;
require valid_user;
}
#
@chrisboulton
chrisboulton / ip_blacklist.lua
Last active April 2, 2024 10:43
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@edhedges
edhedges / gist:2995805
Created June 26, 2012 13:30
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt