A perl distribution builder for ServerCentral perl projects.
To build a module named SCN-Module-Foo
...
cd SCN-Module-Foo
distify SCN-Module-Foo
#!/bin/sh | |
trap 'rm -rf "$PROFILEDIR"' EXIT | |
PROFILEDIR=$(mktemp -p /tmp -d tmp-fx-profile.XXXXXX.d) | |
/path/to/firefox -profile "$PROFILEDIR" -no-remote -new-instance |
#!/bin/zsh | |
# Use an USB light to let FW webcam see | |
PATH=$PATH:/usr/local/bin | |
UHCOPTS=$(uhubctl | awk '{ text=text"\n"$0; if ($0~/hub/) text=$0; if (text~/power$/) { print text; text="" } }' \ | |
| awk -F',| |:' -v ORS=" " '{ print $5 }' | awk '{ print "-p "$2" -l "$1 }') | |
if [ -n "$UHCOPTS" ]; then | |
uhubctl -a 0 ${=UHCOPTS} | |
DEVNAME="iSight"; DEVGUID=$(system_profiler SPCameraDataType | awk -v dev="$DEVNAME:" -F':|x|-' '{ if ($0~dev) n=NR; if (NR==n+3 && NR!=3) print $3 }') |
#!/bin/bash | |
additional_strace_args="$1" | |
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6) | |
while read -r pid; | |
do | |
if [[ $pid != $MASTER_PID ]]; then | |
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 & |
The attack detailed below has stopped (for the time being) and almost all network access for almost all customers have been restored. We're keeping this post and the timeline intact for posterity. Unless the attack resumes, we'll post a complete postmortem within 48 hours (so before Wednesday, March 26 at 11:00am central time).
Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at 8:46 central time, March 24 2014. The goal is to make Basecamp, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.
Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people
NEW! you can install via cpan: https://metacpan.org/release/PACMAN/Acme-CatFS-0.001 | |
1. you should install LWP::Simple and Fuse:Simple - use cpan or cpanm | |
2. you should configure the local fuse install to run as root or as common user | |
3. don't forget 'fusermount -u <mountpoint>' after finish the script | |
to install dependencies | |
you can use regular cpan OR cpanminus ( http://search.cpan.org/~miyagawa/App-cpanminus-1.7001/lib/App/cpanminus.pm ) |
import numpy as np | |
def round_exponential(val): | |
""" | |
Round a value to an integer [1-9] times a power of 10. | |
Example | |
>>> val1 = 7.83126342297e-07 | |
>>> print round_exponential(val1) | |
>>> 8e-07 |
#!/usr/bin/env perl | |
use 5.010; | |
use open qw(:locale); | |
use strict; | |
use utf8; | |
use warnings qw(all); | |
use Mojo::UserAgent; | |
# FIFO queue |
rule-of-thirds bookmarklet that overlays a rule-of-thirds style grid over all images on a page.
To get the bookmarklet, visit http://bl.ocks.org/4331769
Do the following to be able to use the "RuleOfThirds-localhost" development version of the bookmarklet:
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use 5.010; | |
use Mojo::UserAgent; | |
my $url = shift @ARGV or die "Usage: $0 metacpan_author_url"; | |
my $ua = Mojo::UserAgent->new; | |
my $dom = $ua->get($url)->res->dom; |