Skip to content

Instantly share code, notes, and snippets.

View markosamuli's full-sized avatar

MSK markosamuli

View GitHub Profile
@markosamuli
markosamuli / keybase.md
Created February 16, 2017 18:52
keybase.md

Keybase proof

I hereby claim:

  • I am markosamuli on github.
  • I am markosamuli (https://keybase.io/markosamuli) on keybase.
  • I have a public key ASDHbiZ7bB10jYA5giu2TSDyD0Ko16AtHo3eVaY9Y_qwrQo

To claim this, I am signing this object:

@markosamuli
markosamuli / jira-projects.js
Created April 26, 2016 19:22
Scrape a list of JIRA projects
AJS.$('#project-list').find('tbody tr').map(function(i, e) {
var row = $(e);
return {
'key': row.find('td[data-cell-type="key"]').text(),
'name': row.find('td[data-cell-type="name"] a').text(),
'url': row.find('td[data-cell-type="url"] a').text(),
'lead': row.find('td[data-cell-type="lead"] a').text(),
'category': row.find('td[data-cell-type="category"] a').text(),
}}).toArray();
@markosamuli
markosamuli / Dockerfile
Created November 23, 2015 13:46
Django application Dockerfile
# Use base image with Python and Node.js installed
FROM bynd/python
MAINTAINER Marko Samuli Kirves <marko.kirves@bynd.com>
# Define required PostgreSQL version
ENV PG_VERSION 9.4
# Install PostgreSQL client and development libraries for Python
RUN apt-get update -y -q && \
@markosamuli
markosamuli / Docker Compose file for WordPress
Last active August 30, 2017 14:36
docker-compose.yml file for running WordPress
wordpress:
image: wordpress
links:
- db:mysql
volumes:
- "./wp-content:/var/www/html/wp-content"
ports:
- 80:80
db:
@markosamuli
markosamuli / setup-python-virtualenv.sh
Created January 24, 2015 21:18
Jenkins deployment script to fix issues with old distribute package
# Jenkins deployment script virtualenv setup
# Marko Samuli Kirves <hello@msk.io>
# Setup this somewhere earlier
VIRTUALENV_PATH="$HOME/.virtualenvs/deploy-test"
# Create virtualenv if required
if [ ! -d "$VIRTUALENV_PATH" ]; then
# The --no-site-packages flag is deprecated; it is now the default behavior.
virtualenv $VIRTUALENV_PATH --no-site-packages
@markosamuli
markosamuli / ip_to_nation_data.php.patch
Created June 10, 2014 11:56
ExpressionEngine v2.5.5 IP2Nation module SQL bugfix
diff --git system/expressionengine/modules/ip_to_nation/models/ip_to_nation_data.php system/expressionengine/modules/ip_to_nation/models/ip_to_nation_data.php
index 28ab3e0..0188a0e 100755
--- system/expressionengine/modules/ip_to_nation/models/ip_to_nation_data.php
+++ system/expressionengine/modules/ip_to_nation/models/ip_to_nation_data.php
@@ -13,11 +13,12 @@ class Ip_to_nation_data extends CI_Model {
function find($ip)
{
$BIN = $this->to_binary($ip);
+ $BIN = $this->db->escape($BIN);
@markosamuli
markosamuli / vpn-route-add
Created February 5, 2014 16:46
vpn-route-add
#!/bin/bash
SCRIPT=$(basename $0)
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
TARGET_HOST=$1
@markosamuli
markosamuli / install-chocolatey.cmd
Created February 20, 2013 15:20
Install Chocolatey in c:\opt (Windows 7 required)
@echo off
SETX ChocolateyInstall %systemdrive%\opt\chocolatey
SETX chocolatey_bin_root opt
mkdir %systemdrive%\opt
mkdir %systemdrive%\opt\chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\opt\chocolatey\bin