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
$ tx push -s | |
Pushing translations for resource quassel.master: | |
Pushing source file (po/quassel.pot) | |
Resource does not exist. Creating... | |
Cannot get type for resource. Please, add it in the .tx/config file. | |
TypeError: cannot concatenate 'str' and 'NoneType' objects | |
$ cat .tx/config | |
[main] | |
host = https://www.transifex.net |
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
ip6_gw=beef:fac3::1 | |
ip6_vhost=beef:fac3::2 | |
irc_ports=6667:6669 | |
interface=eth0 | |
echo 1 irc6 >> /etc/iproute2/rt_tables | |
ip -f inet6 route add default via $ip6_gw table irc6 dev $interface src $ip6_vhost | |
ip -f inet6 rule add fwmark 1 table irc6 | |
ip6tables -t mangle -I OUTPUT -o $interface -p tcp --dport $irc_ports --syn -j MARK --set-mark 1 |
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/bash | |
set -u | |
basepath="${1:-/}" | |
read device rest < <(df -P "$basepath" | grep ^/) | |
mount | grep "^${device} " | while read dev on mountpoint rest; do | |
[[ "$mountpoint" != "${basepath}" ]] && echo "$mountpoint" | |
done |
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/env bash | |
pushd /var/sadm/pkg && | |
for pkg in *; do | |
[ -f $pkg/install/depend ] && | |
egrep '^[PR] ' $pkg/install/depend | | |
tr '[:space:]' ' ' | | |
cut -d\ -f2 | | |
while read dep; do | |
if ! pkginfo -q $dep; then |
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
$ cat myapp.pl | |
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
get '/' => sub { | |
my $self = shift; | |
my $text; | |
$text = $self->render_partial('a', body => rand()); | |
$text .= $self->render_partial('b', body => rand()); |
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
my $from = [ 'links', 'vlans' ]; | |
my $what = [ 'links.ifname', 'vlans.vlanid' ]; | |
my $where = { 'links.neighbour' => { '=' => \"vlans.device", | |
'like' => $neighbour . '%' | |
}, | |
'links.device' => $device, | |
}; | |
my $order = ''; | |
my $result = $dbh->select($from, $what, $where, $order); |
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
my $cmd = '/bin/cat /proc/cpuinfo'; | |
my $chan = $ssh->channel; | |
$chan->exec($cmd); | |
my $buf; | |
my @poll = ( { handle => $chan, | |
events => [ 'in', 'ext', 'channel_closed' ], }, | |
); |
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
package Net::LDAP::Wrapper; | |
use strict; | |
use parent 'Net::LDAP'; | |
my $_base; | |
sub new { |
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/bash | |
# Basic bash implementation of at(1). Obviously doesn't survive a reboot. | |
poor_mans_at() { | |
delay=$[$(date +%s -d "$*") - $(date +%s)] | |
if [[ ! "$delay" -ge 0 ]]; then | |
echo "error: invalid time specification" >&2 | |
return 1 | |
fi | |
mapfile cmds | |
( sleep $delay && eval "${cmds[@]}" )&disown |
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
$ ./redir.sh 3>&1 >&2 | while read line; do | |
> echo $line go\! | |
> done | |
Hey! | |
Ho! | |
Let's go! | |
$ cat redir.sh | |
#!/bin/bash |