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 / my_bootstrap.make
Last active August 29, 2015 14:18
Drush make example
; My Boostrap makefile
core = 7.x
api = 2
projects[] = drupal
projects[my_bootstrap_profile][type] = profile
projects[my_bootstrap_profile][download][type] = git
projects[my_bootstrap_profile][download][url] = "https://github.com/username/my_bootstrap_profile.git"
projects[my_bootstrap_profile][download][branch] = master
@samueljon
samueljon / my_bootstrap.install
Last active August 29, 2015 14:18
Creating Drupal 7 installation profile https://www.drupal.org/node/1022020
<?php
/**
* Implement hook_install().
*
* Perform actions to set up the site for this profile.
*/
function my_bootstrap_install() {
include_once DRUPAL_ROOT . '/profiles/minimal/minimal.install';
minimal_install();
@samueljon
samueljon / my_bootstrap.info
Last active August 29, 2015 14:18
How to write an Drupal 7 installation profile - https://www.drupal.org/node/1022020
name = My Bootstrap Profile
description = Description of what the profile does.
core = 7.x
; Optional: Mark your installation profile as exclusive, so that the installer
; will auto-select it.
exclusive = true
dependencies[] = block
dependencies[] = color
dependencies[] = comment
@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 {
@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 / 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 <sammi@kosmosogkaos.is>
* 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 / analyze_logs.sh
Created October 20, 2014 22:18
Analyzing specific data from the blcg_module
#!/bin/bash
#
# Author: Samúel Jón Gunnarsson <sammi@kosmosogkaos.is>
#
# Access log
echo "Analysing access_log for 2014"
log_path="/var/log/httpd"
grep_pattern="-2014"
#
@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 / 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 / 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