$ docker run -d \
--name mysql \
-e MYSQL_ROOT_PASSWORD=mysecretpassword \
mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cloudsigma | |
name = 'SomeName' | |
drive = cloudsigma.resource.Drive() | |
server = cloudsigma.resource.Server() | |
gb_in_bytes = 1024 * 1024 ** 2 | |
test_disk = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NEWDEV='/dev/vdb' | |
# Partition the new disk as LVM | |
echo -e "n\np\n1\n\n\nt\n8e\nw" | sudo fdisk $NEWDEV | |
# Initiate the disk | |
sudo pvcreate $NEWDEV\1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytumblr | |
import requests | |
from pprint import pprint | |
from re import findall | |
from urlparse import urlparse | |
tumblr_blog = 'blog.viktorpetersson.com' | |
wordpress_site = 'http://viktorpetersson.com/' | |
source_file = '/Users/mvip/Desktop/pages.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"device_name": "My Sync Device", | |
"listening_port" : 0, // 0 - randomize port | |
/* storage_path dir contains auxilliary app files if no storage_path field: .sync dir created in the directory | |
where binary is located. otherwise user-defined directory will be used */ | |
// "storage_path" : "/home/user/.sync", | |
/* set location of pid file */ | |
// "pid_file" : "/var/run/btsync/btsync.pid", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export FOO="One ""Two ""Three" | |
$ echo $FOO | |
One Two Three | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import sys | |
import cloudsigma | |
import base64 | |
import random | |
import string | |
import re | |
from urlparse import urlparse | |
from datetime import date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example from http://www.screenlyapp.com/use-cases/dashboard/nagios.html | |
ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3 | |
ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3 | |
Alias /nagios3/stylesheets /etc/nagios3/stylesheets | |
Alias /nagios3 /usr/share/nagios3/htdocs | |
<Location /abc123> | |
# Hard code credentials | |
AuthBasicFake nagiosadmin nagiosadmin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Inspired by Craig Addyman (http://www.craigaddyman.com/parse-an-xml-sitemap-with-python/) | |
Enhanced by Viktor Petersson (http://viktorpetersson.com) / @vpetersson | |
""" | |
from bs4 import BeautifulSoup | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get update | |
Ign http://ch.archive.ubuntu.com trusty InRelease | |
Ign http://ch.archive.ubuntu.com trusty-updates InRelease | |
Hit http://ch.archive.ubuntu.com trusty Release.gpg | |
Hit http://ch.archive.ubuntu.com trusty-updates Release.gpg | |
Hit http://ch.archive.ubuntu.com trusty Release | |
Hit http://ch.archive.ubuntu.com trusty-updates Release | |
Hit http://ch.archive.ubuntu.com trusty/main Sources | |
Hit http://ch.archive.ubuntu.com trusty/universe Sources | |
Hit http://ch.archive.ubuntu.com trusty/main amd64 Packages |
OlderNewer