Skip to content

Instantly share code, notes, and snippets.

This is an experimental installer for WebGUI8 that attempts to use the
system package manager rather than the WRE.
It is currently incomplete -- it doesn't set up WebGUI or MySQL to run
at boot time, and it doesn't set up cron, and a few other things.
It uses a Curses interface, asking the user about install options
(paths and passwords and such), and getting confirmation before running
commands.
import os
import sys
import platform
import shutil
import cPickle
org_state_file_path = os.path.expanduser('~/.config/deluge/state/torrents.state')
new_state_file_path = os.path.expanduser('~/torrents.state.new')
state_file_org = open(org_state_file_path, 'rb')
@three18ti
three18ti / truth_in_values.pl
Last active December 20, 2015 21:39
Truth test perl
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
%hash ? say "Empty Hash is true" : say "Empty Hash is false" ;
scalar keys %hash > 0 ? say "Empty Hash is true" : say "Empty Hash is false" ;
%hash = ( foo => 1, bar => 2 );
PRAGMA foreign_keys = ON;
BEGIN TRANSACTION;
DROP TABLE IF EXISTS server;
CREATE TABLE server (
id INTEGER PRIMARY KEY,
name VARCHAR UNIQUE,
notes VARCHAR
);
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
$Data::Dumper::Deparse = 1;
# syntactic sugar
sub NEXTVAL { $_[0]->() }
sub Iterator (&) { return $_[0] }
770
404
718
203
901
305
312
313
215
803
package My::App;
use 5.010;
use Moose;
use strict;
use warnings;
use MooseX::HasDefaults::RO;
has [qw( foo bar )] => (
isa => 'Int',
required => 1,
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
BEGIN {
eval {
require 'lib/Foo.pm';
};
print $@;
package Foo::Bar;
use strict;
use warnings;
1;
@three18ti
three18ti / install.txt
Last active August 29, 2015 14:02
Calamari installation (for a dev environment)
1) Install all packages, including nodejs and npm (I always install build essential on dev machines, I've included it here for accuracy)
2) install grunt and compass
3) set environment variables
4) checkout calamari to /opt/workspace
5) create virtualenv
6) activate virtualenv (very important step I was missing on my first run through, it's implied but I'm not well versed in Python so it was definitely an "Ah ha!" moment)
7) use pip to install dependencies, the `pip install -r requirements/debian/requirements.force.txt` tends to complete with an already satisfied." but I continue to run it anyway.
8) Checkout calamari-clients to alternate directory
9) run make dist on calamari-clients directory
10) copy resulting contents to your webapp/contents directory (`make dist`, `make build-real`, or `make ui`, which is correct? there's a tarball that's involved somehow too... what's the deal with that?)