Skip to content

Instantly share code, notes, and snippets.

View gen2brain's full-sized avatar
💭
Busy

Milan Nikolic gen2brain

💭
Busy
  • Belgrade, Serbia
View GitHub Profile
@fernandoaleman
fernandoaleman / rpm-digital-signature.sh
Created November 18, 2011 15:18
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
Index: OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm
===================================================================
--- a/src/osgViewer/DarwinUtils.mm (revision 12292)
+++ b/src/osgViewer/DarwinUtils.mm (revision 12790)
@@ -48,4 +48,23 @@
namespace osgDarwin {
+//
+// Lion replacement for CGDisplayBitsPerPixel(CGDirectDisplayID displayId)
+//
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@niranjan-nagaraju
niranjan-nagaraju / tcpdump_tcpreplay.org
Last active October 26, 2023 10:15
TCPReplay/TCPRewrite/TCPPrep/TCPDump Cheatsheet

TCPReplay/TCPRewrite/TCPPrep/TCPDump Cheatsheet

tcprewrite

Rewrite IP/Mac addresses, -C optionally to fix checksums

  1. tcpprep, first:C2S, Second S2C, Generate cache file
        
@liftoff
liftoff / xcb_screenshot.py
Last active January 21, 2021 10:51
An example of how to capture a screenshot using xpyb (xcb bindings for Python). UPDATED 2013-02-13: Now using PIL's Image.frombuffer() method on the raw image data object given by xcb. It is an order of magnitude faster than converting the xcb object to a Python string and using PIL's Image.fromstring().
#!/usr/bin/env python
"""
An example demonstrating how to use xpyb (xcb bindings for Python) to take a
full-screen screenshot.
"""
# Meta
__version__ = '1.0'
__version_info__ = (1, 0)
@antoche
antoche / HockeySender.java
Created March 9, 2013 07:44
HockeyApp ACRA sender that inserts all ACRA data (including logs)
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.acra.ACRA;
import org.acra.collector.CrashReportData;
import org.acra.ReportField;
import org.acra.sender.ReportSender;
@roxlu
roxlu / X264Encoder.cpp
Created June 26, 2013 21:01
X264 encoder example
#include <roxlu/core/Log.h>
#include <roxlu/core/Utils.h>
#include <video/X264Encoder.h>
X264Encoder::X264Encoder()
:in_width(0)
,in_height(0)
,in_pixel_format(AV_PIX_FMT_NONE)
,out_width(0)
,out_height(0)
@samalba
samalba / main_test.go
Created July 23, 2013 02:50
How to assert values in golang unit tests
package main
import (
"fmt"
"testing"
)
func assertEqual(t *testing.T, a interface{}, b interface{}, message string) {
if a == b {
return
@bellbind
bellbind / avcapture.m
Last active June 19, 2023 01:21
[objective-c][macosx]capturing image from webcam
// capture image from webcam(e.g. face time)
// for OSX 10.9 (use AVFoundation API instead of deprecated QTKit)
// clang -fobjc-arc -Wall -Wextra -pedantic avcapture.m
// -framework Cocoa -framework AVFoundation -framework CoreMedia
// -framework QuartzCore -o avcapture
#import <AVFoundation/AVFoundation.h>
#import <AppKit/AppKit.h>
@interface Capture : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>