Skip to content

Instantly share code, notes, and snippets.

View tjoskar's full-sized avatar

Oskar Karlsson tjoskar

View GitHub Profile
@tjoskar
tjoskar / cordovaCI.md
Last active December 26, 2015 18:49
Phonegap/cordova CI. Phonegap/cordovas documentation is lacking on certain areas, here is a file to summarize some commands

Create a new project

$ cordova create [path] [id] [name] #eg. create . sub.dom.top Example

Add platform

$ cordova platform add ios
@tjoskar
tjoskar / InstallSelenium.md
Last active December 31, 2015 15:29
Install Selenium in your headless VM

Install Selenium using vagrant

Install oracle java The official java packages has been removed from the Ubuntu repositories

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
@tjoskar
tjoskar / .aliases
Last active August 29, 2015 13:56
Install files for my vagrant box. Based on Vaprobash
# PHP
alias art="php artisan"
# Git
alias commitmsg='curl -s http://whatthecommit.com/index.txt'
# Shortcuts
alias v="cd /vagrant"
alias cl='clear'
@tjoskar
tjoskar / unix.md
Last active August 29, 2015 13:57

UNIX (ubuntu) Commands

Remove gpg key.

$ sudo apt-key list
pub   1024R/B455BEF0 2010-07-29
uid                  Launchpad clicompanion-nightlies
$ sudo apt-key del B455BEF0

GIT Commands

Reset local repository to be just like the remote repository HEAD

$ git fetch origin
$ git reset --hard origin/master
@tjoskar
tjoskar / VirtualBoxHDDSize.md
Last active August 29, 2015 14:00
Increase VirtualBox HDD Size

Create a new disk

  1. Turn off your guest OS
  2. Launch VirtualBox. Click on "Settings" for the virtual machine you want to change.
  3. Click on "Storage" on the left side.
  4. Click the icon that looks like a spindle of discs with a green plus sign next to "SATA Controller" (or whatever you use). "Add Hard Disk"
  5. Click the "Create New Disk" button
  6. Select "VDI (VirtualBox Disk Image" and click "Next"
  7. Click "Dynamically Allocated" and then click "Next"
  8. Select size and click "Create"
@tjoskar
tjoskar / python-mysql.md
Created April 30, 2014 07:52
Install python-mysql on OS X Maverics

My mysql_config is in /usr/local/mysql/bin/ so add it to the PATH:

$ PATH="$PATH:/usr/local/mysql/bin/"

And make sure clang don't complain about unrecognized flags:

$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install MySQL-python
@tjoskar
tjoskar / app.py
Created September 14, 2014 12:07
Tellstick server
import os
import datetime
import pytz
from flask import Flask
from astral import Astral
app = Flask(__name__)
__TELLSTICK_PATH__ = '/usr/bin/tdtool'
__WINDOW_ID__ = ['1', '2', '3']
@tjoskar
tjoskar / XBMC_light.py
Created September 14, 2014 12:32
Turn off lamps when using XBMC
import urllib
import xbmc
__HOST__ = '192.168.0.15'
__PORT__ = '8000'
class MyPlayer(xbmc.Player):
__is_playing = False
__url = 'http://' + __HOST__ + ':' + __PORT__
<?php
$username = '';
$password = '';
$points = '';
$login_url = 'https://www3.student.liu.se/portal/login';
$redirect = 1;
$redirect_url = '/portal/sv/portal/';
$time = 0;
$login_para = '';