Skip to content

Instantly share code, notes, and snippets.

View dossy's full-sized avatar
🍪
derping around

Dossy Shiobara dossy

🍪
derping around
View GitHub Profile
@ashrithr
ashrithr / readme.md
Last active January 14, 2025 07:49
Installing ELK on a single machine

Installing ELK (CentOS)

This is a short step-by-step guide on installing ElasticSearch LogStash and Kibana Stack on a CentOS environment to gather and analyze logs.

I. Install JDK

rpm -ivh https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm
@dossy
dossy / jquery-ui-require.js
Created April 7, 2014 15:12
Loading just jquery.ui.resizable with requireJS
<script type="text/javascript">
// http://matznermatzner.de/en/bernd/2013/11/loading-non-amd-modules-requirejs-part-1-jquery-ui/
requirejs.config({
paths: {
'jquery.ui.core': 'lib/jquery-ui/1.10.4/ui/minified/jquery.ui.core.min',
'jquery.ui.mouse': 'lib/jquery-ui/1.10.4/ui/minified/jquery.ui.mouse.min',
'jquery.ui.resizable': 'lib/jquery-ui/1.10.4/ui/minified/jquery.ui.resizable.min',
'jquery.ui.widget': 'lib/jquery-ui/1.10.4/ui/minified/jquery.ui.widget.min',
},
shim: {
@davepeck
davepeck / oops.c
Created February 22, 2014 10:07
iOS 7.0.6 "Security Content"
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
uint8_t *signature, UInt16 signatureLen)
{
OSStatus err;
SSLBuffer hashOut, hashCtx, clientRandom, serverRandom;
uint8_t hashes[SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN];
SSLBuffer signedHashes;
uint8_t *dataToSign;
size_t dataToSignLen;
@timusg
timusg / keepalived-eip-switch.erb.sh
Last active October 20, 2016 21:01
keepalived notification script for switch elastic ip, helpful to setup highly available haproxy in ec2/VPC
#!/bin/bash
export EC2_HOME=/usr/local/share/ec2_tools/
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:$EC2_HOME/bin
INSTANCEID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
case "$1" in
MASTER)
logger triggering notify master event
@sstur
sstur / dom-to-json.js
Last active October 8, 2023 04:17
Stringify DOM nodes using JSON (and revive again)
function toJSON(node) {
let propFix = { for: 'htmlFor', class: 'className' };
let specialGetters = {
style: (node) => node.style.cssText,
};
let attrDefaultValues = { style: '' };
let obj = {
nodeType: node.nodeType,
};
if (node.tagName) {
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@duncansmart
duncansmart / progressive-ace.htm
Created March 28, 2013 23:29
Integrating ACE Editor in a progressive way
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {
@dossy
dossy / ipmitool-1.8.11-99.dell.patch
Created May 30, 2012 20:26
Dell patches to ipmitool-1.8.11 from Redhat SRPM
This file has been truncated, but you can view the full file.
The following patch is a combination of the Dell contributions to ipmitool, taken from the following Dell tarball for the corresponding RPM:
http://opensource.dell.com/releases/BMU/ipmitool-1.8.11-99.dell.tar.bz2
This patch was generated by diff'ing the upstream ipmitool-1.8.11 source against the ipmitool-1.8.11-99.dell source, with the following command:
% diff -urN -x .git -x autom4te.cache -x Makefile -x config.h -x config.log -x config.status -x '*.keep' -x .deps -x '*.spec' ipmitool-1.8.11 ipmitool-1.8.11-99.dell > ipmitool-1.8.11-99.dell.patch
Release Notes.txt | 9
ipmitool-1.8.11-99.dell/CHANGES.txt | 8
@claylevering
claylevering / bitly.sh
Created February 15, 2012 02:20
Bit.ly Alfred App Extension
# modified API url to align with changes to bit.ly requirements - @claylevering
# find the .alfredextension here: http://cl.ly/EEUK
declare -r API='https://api-ssl.bitly.com/v3/shorten'
declare -r LOGIN='yourlogin'
declare -r API_KEY='yourapi'
# add http scheme to URL if none is provided
longURL=$(printf "{query}" | sed -E -e 's|^.|http://&|' -e 's|^http://([a-zA-Z\-\.\+]+://)|\1|')
@pfig
pfig / mkfavicon.sh
Created February 12, 2012 12:01
Make a multi-resolution favicon.ico from a source image, using ImageMagick
#!/bin/bash
# from
# http://bergamini.org/computers/creating-favicon.ico-icon-files-with-imagemagick-convert.html
convert source-WxW.png -resize 256x256 -transparent white favicon-256.png
convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png