Skip to content

Instantly share code, notes, and snippets.

View akostadinov's full-sized avatar

Aleksandar N. Kostadinov akostadinov

View GitHub Profile
@phibo23
phibo23 / fb2ical.php
Last active October 5, 2015 12:47 — forked from cognitom/fb2ical.php
Export ical format for Facebook page's events by cognitom. Modifications: pageId as parameter, restriction to public events, improved timezone adjustment, ignore exceptions
<?php
/*
original code by cogitom: https://gist.github.com/997980/
This script reads future events (plus several days into the past) from Facebook pages
and creates a subscribable iCalendar
Improvements upon the original version:
- fixed start and endtime reading
- timezone adjustment done on facebook's side (more reliable)
@kpiwko
kpiwko / scl_sudo
Created May 7, 2015 06:43
Red Hat SCL Sudo wrapper
#! /bin/sh
# TODO: parse & pass-through sudo options from $@
sudo_options="-E"
scls=$X_SCLS
#available_scls="`scl --list | tr '\n' ' ' | sed 's/ $//'`"
for arg in "$@"
do
case "$arg" in
*\'*)
@jkullick
jkullick / fdisk-sector-63.md
Last active December 29, 2016 13:28
Force Sector 63 Boundary in fdisk
fdisk -c=dos -u=cylinders /dev/sdb

Source

@gregretkowski
gregretkowski / logger_trace.rb
Created October 11, 2012 16:25
Adding 'trace' to ruby Logger
require 'logger'
# Monkeypatch a 'trace' loglevel into ruby Logger
class Logger
module Severity; TRACE=-1;end
def trace(progname = nil, &block);add(TRACE, nil, progname, &block);end
def trace?; @level <= TRACE; end
end
l = Logger.new(STDERR)
l.level = Logger::TRACE
@trevorrowe
trevorrowe / client.rb
Created June 29, 2015 21:03
Ruby Net::HTTP Expect-100 continue PUT bug
require 'net/http'
require 'logger'
req = Net::HTTP::Put.new('/', { 'expect' => '100-continue' })
req.body = 'data'
http = Net::HTTP.new('localhost', 3000)
http.continue_timeout = 1
http.set_debug_output(Logger.new($stdout))
http.request(req)
@cognitom
cognitom / fb2ical.php
Created May 29, 2011 17:36
Export ical format for Facebook page's events
<?php
// https://github.com/facebook/php-sdk/
require_once 'path/to/facebook.php';
// http://www.kigkonsult.se/iCalcreator/
require_once 'path/to/iCalcreator.class.php';
$config = array(
'appId' => 'xxxx',//change to your fb app id
'secret' => 'yyyy',//change to your fb app secret
'pageId' => 'shimokitazawa.osscafe',//change to target fb page id
@detiber
detiber / atomic-openshift-installer-config.yml
Last active August 30, 2018 17:17
openshift-ansible-installer config example
---
version: v3
variant: openshift-enterprise
variant_version: '3.1'
# The deployment key specifies the hosts and roles fo rthe deployment
# and configuration values that apply to the deployment as a whole
deployment:
ansible_config: /usr/share/atomic-openshift-utils/ansible.cfg
ansible_log_path: /tmp/ansible.log
@jehrhardt
jehrhardt / KeyLengthDetector.java
Created March 15, 2013 06:23
Detect the allowed size of AES keys on the JVM. If the size is <= 256, it is limited. To fix it JCE unlimted stregth files are needed.
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
public class KeyLengthDetector {
public static void main(String[] args) {
int allowedKeyLength = 0;
try {
allowedKeyLength = Cipher.getMaxAllowedKeyLength("AES");
} catch (NoSuchAlgorithmException e) {
@olim7t
olim7t / git-standup.sh
Created October 1, 2012 08:44
git-standup: find out what you did yesterday (or last friday)
#!/bin/bash
# git-standup: find out what you did yesterday (or last friday).
#
# Setup:
# 1. Change AUTHOR if your git user doesn't match your unix account.
# 2. Save somewhere on your path, make executable.
# 3. git config --global alias.standup '!git-standup'
# 4. Profit.
#
# Original idea via @paulgreg (https://twitter.com/paulgreg/status/248686055727972352)
@natritmeyer
natritmeyer / Rakefile
Created June 10, 2013 13:49
How to add task dependencies to custom rake tasks that don't allow for the normal rake task behaviour around setting task dependencies.
# Example Rakefile that demonstrates how to add task dependencies
# to custom rake tasks that don't allow for the normal rake task
# behaviour around setting task dependencies.
require 'cucumber/rake/task'
# here's the task that I want to run before any of my cucumber tasks (see below)
namespace :stub do
desc "Start stub required by features"
task :start do