Skip to content

Instantly share code, notes, and snippets.

Se http://goodold.se/blog/tech/git-workflow-going-live för allmän info.
Specifikt för Ostnet:
Lägga upp SSH-nyckel:
$ scp ~/.ssh/goodold_rsa.pub root@vps-XXXX.cloudnet.se:~/goodold_rsa.pub
-enter password
$ ssh root@vps-XXXX.cloudnet.se
-enter password
$ cat goodold_rsa.pub >> /mnt/persist/cloudnet/ssh_public_keys
// ==UserScript==
// @name Localhost
// @namespace GoodOld
// @include http://*.local/
// ==/UserScript==
/*
Displays a bagde when surfing .local pages.
*/
// ==UserScript==
// @name Localhost
// @namespace Perifer
// @include http://*.local/*
// ==/UserScript==
(function() {
div = document.createElement("div");
div.innerHTML = '<style type="text/css" media="screen">#LocalBadge{position:fixed;right:-45px;top:-25px;z-index:99999} #LocalBadge > div{font:15px/17px Helvetica,Arial,sans-serif;-webkit-transform:rotate(45deg);-webkit-transform-origin:0 0;-webkit-box-shadow:0 0 5px #000;-moz-transform:rotate(45deg);-moz-transform-origin:0 0;-moz-box-shadow:0 0 5px #000;background:#222;background:-webkit-gradient(linear,left top,left bottom,from(#444),to(#222));width:70px;padding-top:15px;text-align:center;color:#E458B4;}</style><div id="LocalBadge"><div>local</div></div>';
document.body.appendChild(div);
# Place the following at the end of ~/.profile:
# if [ -f ~/.ostnet_profile ]; then
# source ~/.ostnet_profile
# fi
# Remove duplicates from history.
export HISTCONTROL=erasedups
# Aliases
alias ls="ls -al --color=auto"
> Lines beginning with `>` are comments.
> Comments and empty lines are ignored.
>
> Each command is defined on a single line comprised of:
>
> 1. a case-insensitive, alpha-numeric trigger followed
> by whitespace
> 2. a url followed by whitespace (if the url contains
> spaces they must be encoded as `%20`)
> 3. a short description
<?php
/**
* Returns all the layers in the tile service.
*
* @return array
*/
function simplegeo_tileservice_get_layers() {
static $layers;
$cache_key = 'simplegeo_tileservice:layers';
<?php
class RunningRouteResource {
/**
* Creates a running route.
*/
public static function create($data) {
global $user;
@perifer
perifer / todaystime.html
Created December 3, 2010 16:19
Bookmarklet to show todays reported time in Basecamp
<html>
<body>
Change the userID below and then drag the link to your bookmarks bar.
<a href="javascript:
var userID=3030954;
var domain='https://goodold.basecamphq.com';
var t=new Date();
var m=t.getMonth()+1;
@perifer
perifer / switch_collation.php
Created December 20, 2010 15:32
Script for change the collation of a database's table (utf8)
#!/usr/bin/env php
<?php
/**
* Script for change the collation of a database's table's
*/
if ($argv[1] == '-h') {
echo "Usage:\n\tphp collation_switch.php sql-user sql-password sql-database target-collation target-character\nExample: php collation_switch.php USER PASS DATABASE utf8_swedish_ci utf8\n";
die();
}
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName plan.goodold.net
<IfModule mpm_itk_module>
AssignUserId plan plan
</IfModule>
DocumentRoot /home/plan/plan.goodold.net
<Directory /home/plan/plan.goodold.net>