Skip to content

Instantly share code, notes, and snippets.

View samueljon's full-sized avatar

Samúel Jón Gunnarsson samueljon

View GitHub Profile
@samueljon
samueljon / .gitconfig
Last active September 26, 2015 04:57
GitConfig
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
@samueljon
samueljon / linkedlist.cpp
Created December 11, 2011 21:27
frá dodda fyrir dodda
#include <iostream>
using namespace std;
struct linkNode {
int data;
linkNode* nextnode;
};
void thefunction(linkNode* a){
std::cout << "thefunction\n";
while (a->nextnode != NULL){
@samueljon
samueljon / gist:1477598
Created December 14, 2011 17:37
Hugtakalisti fyrir þýðingu á WordPress
Comment => Athugasemd
Theme => Þema
Plugin => Viðbót
Documentation on => Skjölun á
Toolbar => Tækjaslá
Pingback => Bakvísun
Trackback => Bakrakning
Tag => efnisorð
Template => Skapalón
Navigation => Leiðarstýring
@samueljon
samueljon / logstash RPM spec
Created October 13, 2012 18:51 — forked from slojo404/logstash RPM spec
logstash monolithic init script and spec file for CentOS / RedHat
Name: logstash
Version: 1.1.0
Release: 1%{?dist}
Summary: logstash is a tool for managing events and logs
Group: System/Logging
License: ASL 2.0
URL: http://logstash.net/
Source0: http://semicomplete.com/files/logstash/logstash-%{version}-monolithic.jar
Source1: logstash
@samueljon
samueljon / zfs.ext4.btrfs.benchmark.txt
Created March 30, 2013 18:39
Bonnie++ benchmark taken on HP Proliant ML150G3 with E5110 1,6Ghz Dual Core CPU with 4GB ram and 8GB swap. The swap file is on the zfs filesystem. Hard disk tested was scsi-SATA_WDC_WD1600JD-00WD-WMAL91171631.
-------------------------------------------------------------------------------
btrfs
-------------------------------------------------------------------------------
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
loki 8G 211 98 52517 7 24589 6 1805 94 61643 11 168.1 5
Latency 71702us 10393ms 10891ms 18017us 210ms 355ms
Version 1.96 ------Sequential Create------ --------Random Create--------
loki -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
@samueljon
samueljon / keepass_install.sh
Last active July 15, 2020 10:20
Install wine + dotnet on osx via brew
#!/bin/bash
brew install wine-stable winetricks
WINEARCH=win32 WINEPREFIX=~/.wine winecfg
mkdir ~/.cache/winetricks/
winetricks -q dotnet45 corefonts
@samueljon
samueljon / analyze_logs.sh
Created October 20, 2014 22:18
Analyzing specific data from the blcg_module
#!/bin/bash
#
# Author: Samúel Jón Gunnarsson <[email protected]>
#
# Access log
echo "Analysing access_log for 2014"
log_path="/var/log/httpd"
grep_pattern="-2014"
#
@samueljon
samueljon / update_stats.php
Created October 22, 2014 13:04
Harvesting data from the link_stat table from facebook through fql query. The script is throttled due to api rate limits.
<?php
/**
* Author: Samúel Jón Gunnarsson <[email protected]>
* Date: 21.10.14
* Time: 13:41
*/
$debug = 0;
$base_path="http://my.url";
// Determine if we are running in command line or not.
if (php_sapi_name() == "cli") {
@samueljon
samueljon / NTLMSoapClient.inc
Created November 29, 2014 02:25
NTLM enabled SOAPCLIENT. Needs NTLMStream.inc for it to work.
<?php
/**
* User: samueljon <samuel.jon.gunnarsson _at_ gmail.com>
* Date: 14.10.14
* Time: 08:16
*/
/**
* Class NTLMSoapClient
*
@samueljon
samueljon / designer.html
Last active August 29, 2015 14:15
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {