rsync - --progress /path/TO/copy /path/TO/dest
This file contains hidden or 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
| app.use(function(req, res, next){ | |
| // verify that user is a valid authenticated one | |
| if( req.facebook.getSession() ){ | |
| // get user info then | |
| req.facebook.api('/me', function(me){ | |
| console.log(me); | |
| }); | |
| }; | |
| next(); |
This file contains hidden or 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/perl -w | |
| use strict; | |
| use Data::Dumper; | |
| sub t1 { | |
| my ($v) = @_; | |
| $$v = {hey => "you", there => 'me'}; | |
| } |
This file contains hidden or 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
| sub duplicateAction { | |
| my ($s, $context) = @_; | |
| my ($oldAction, $newAction) = eval { | |
| # verify correct arguments specified | |
| map { if(!exists($Form->{$_})) { die "invalid arguments"; } } qw(build type target); | |
| BS::db::action->do_transaction(sub{ | |
| my $actionType = BS::db::actionType->find_or_create( name => $Form->{type} ); | |
| my $target = BS::db::target->find_or_create( name => $Form->{target} ); |
This file contains hidden or 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
| sub versions { | |
| my ($s) = @_; | |
| # get a summary of the actions for this build (in some cases all versions will be the same) | |
| my $sth = BS::db::action->db_Main->prepare(<<SQL); | |
| select max(action_id) from actions where build_id = ? group by branch_id, revision, storm_branch_id, storm_revision, build_id; | |
| SQL | |
| $sth->execute($s->id); | |
| return BS::db::action->sth_to_objects($sth); |
This file contains hidden or 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
| ([regex]'\/([\w|\.]+)$').matches("http://somerandomwebsite.com/branches/4.8release")[0].Groups[1].Value |
This file contains hidden or 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
| use Data::Dumper; | |
| $s = "1-19A"; | |
| @a = $s =~ m/(\d+)\-(\d+)([A-Z])?/i; | |
| print Dumper(@a) |
Use node-inspector to debug hubot!
sudo npm install -g node-inspector
coffee --nodejs --debug $(which hubot)
This file contains hidden or 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/sh | |
| echo -e "deb http://apt.puppetlabs.com/ lucid main\ndeb-src http://apt.puppetlabs.com/ lucid main" >> /etc/apt/sources.list.d/puppet.list | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30 | |
| apt-get update | |
| apt-get install puppet |
This file contains hidden or 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
| class dummyPackage { | |
| package { 'yourpackagename': | |
| ensure => installed|absent, | |
| provider => dpkg, | |
| source => '/path/to/file.deb', | |
| } | |
| } | |
| class { 'dummyPackage': } |