-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shrc_bsd
83 lines (72 loc) · 2.03 KB
/
.shrc_bsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# BSD style interactive environment.
# enable color support
if [ "$TERM" != "dumb" ]; then
alias 'ls=ls -GF'
fi
# Package administration shortcuts
alias pta='sudo portaudit -Fda '
alias pts='sudo portsnap fetch update '
alias ptu='sudo sysctl dev.acpi_ibm.0.fan=0;sudo sysctl dev.acpi_ibm.0.fan_level=7; sudo portupgrade '
alias ptv='sudo sh -c "pkg_version -vL= | tee /var/log/pkg_version"'
alias ptd='sudo portdowngrade -s :pserver:[email protected]:/home/ncvs '
alias sfan='sudo /etc/rc.d/powerd start;sudo sysctl dev.acpi_ibm.0.fan=1;'
alias ufan='sudo sysctl dev.acpi_ibm.0.fan=0;sudo sysctl dev.acpi_ibm.0.fan_level=7;sudo /etc/rc.d/powerd stop ;sudo sysctl dev.cpu.0.freq=1400'
# Autres
alias lpr='/usr/local/bin/lpr'
# Network
nst ()
{
for i in `sudo pfctl -s Tables 2>/dev/null`;do
echo "$i:"
sudo pfctl -t $i -Tshow 2>/dev/null
done
}
nvpn_down ()
{
sudo vpnc-disconnect
for i in `sudo pfctl -s Tables 2>/dev/null`;do
echo $i | egrep -q 'vpn_' && sudo pfctl -t $i -Tflush 2>/dev/null
done
}
alias nvpn_up="sudo $HOME/bin/vpnc.sh"
get_perl_example ()
{
set -e
local package="$1";
local port="$package";
local tmpd='/tmp/p5-ex';
local old_dir="$PWD";
local sd='/usr/ports';
if echo "$1" | grep -q '::' || echo "$1" | grep -v -q '^p5'; then
port=p5-`echo $package | sed 's/::/-/g'`;
fi
local ex="$HOME/share/examples/$port"
local portds="` export display="path" ; \
(cd $sd && make search name=$port | awk '{print \$2}')`"
local portd="";
## select p in $portds; do
# portd="$p";
# [ -n "$portd" ] && break;
# done
mkdir -p $ex;
rm -rf $tmpd
mkdir -p $tmpd
cd $tmpd
cp -a $portd .
cd *;
make extract;
cd work/[A-Za-z0-9]*
cp -a * $ex
cd $old_dir
echo "Examples copied to $ex";
set +e;
}
search_perl_pkg ()
{
local pkg="$1";
local odir="$PWD";
cd /usr/ports;
export display="name,path,info"
make search name=p5-`echo -n $pkg| tr -s ':' | tr : -`
cd "$odir"
}