Skip to content

Instantly share code, notes, and snippets.

💻
Work work

Wojtek Siudzinski suda

💻
Work work
Block or report user

Report or block suda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active Dec 14, 2019
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@jgoodall
jgoodall / README.md
Last active Dec 12, 2019
This is a sample of how to send some information to logstash via the TCP input from node.js or python.
View README.md

This is a sample of how to send some information to logstash via the TCP input in nodejs or python. It assumes the logstash host is on 10.10.10.100 and the TCP listening input is 9563.

The logstash.conf should look something like the sample file.

The log message should be a stringified JSON object with the log message in the @message field.

To use, run the node script node sendMessageToLogstash.js, or the python script python sendMessageToLogstash.js

@davisford
davisford / setup-avahi.sh
Created Jul 12, 2013
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
View setup-avahi.sh
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
@andyvanee
andyvanee / .ssh_config
Last active Dec 3, 2019
Fix unix_listener too long for Unix domain socket
View .ssh_config
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto
@pjkix
pjkix / css-stats-ack.sh
Created Oct 5, 2011
shell script to generate some css file statistics
View css-stats-ack.sh
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@bitoiu
bitoiu / instructions.md
Last active Nov 28, 2019
Self-Signed Wildcard certificate with SAN using openssl / SSL
View instructions.md

Copy the default template of openssl.cnf to a writable location.

cp /System/Library/OpenSSL/openssl.cnf src

Uncomment the req_extensions = v3_req

req_extensions = v3_req # The extensions to add to a certificate request

Add subjectAltName to v3_req section

@armornick
armornick / playwav.c
Created Aug 24, 2012
Play a sound with SDL2 (no SDL_Mixer)
View playwav.c
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
@Jaybles
Jaybles / UIDeviceHardware.h
Created Oct 28, 2011
UIDeviceHardware - Determine iOS device being used
View UIDeviceHardware.h
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@arriolac
arriolac / TopCropImageView.java
Last active Nov 17, 2019
Custom Android ImageView for top-crop scaling of the contained drawable.
View TopCropImageView.java
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.
@antonfisher
antonfisher / allow-privileged-for-microk8s.md
Last active Nov 13, 2019
MicroK8s add --allow-privileged=true flag
View allow-privileged-for-microk8s.md

Add --allow-privileged=true to:

# kubelet config
sudo vim /var/snap/microk8s/current/args/kubelet

#kube-apiserver config
sudo vim /var/snap/microk8s/current/args/kube-apiserver

Restart services:

You can’t perform that action at this time.