Skip to content

Commit b25c723

Browse files
committed
scripts from echo added
1 parent fc4c8e8 commit b25c723

File tree

9 files changed

+114
-0
lines changed

9 files changed

+114
-0
lines changed

clean_configs-greylist

Whitespace-only changes.

clean_configs-whitelist

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.bash_history
2+
.bash_logout
3+
.bashrc
4+
.emacs
5+
.emacs.d
6+
.gitconfig
7+
.gtkrc-2.0
8+
.gtkrc-2.0-color
9+
.gtkrc-2.0-key
10+
.mozilla
11+
.mozilla-thunderbird
12+
.profile
13+
.purple
14+
.rxvt-unicode-*
15+
.sig
16+
.Skype
17+
.ssh
18+
.Xdefaults
19+
.xmodmap
20+
.xsession
21+

clean_configs.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
# deletes config files that were generated this session and not last
3+
4+
whitelist="${HOME}/scripts/clean_configs-whitelist"
5+
greylist="${HOME}/scripts/clean_configs-greylist"
6+
wd="${HOME}"
7+
8+
cd $wd
9+
delete=$(
10+
ls -d $(cat $whitelist) \
11+
$(cat $greylist) | \
12+
diff - <(ls -A | awk '/^\./') | \
13+
awk '/^>/ { for (i = 2; i <= NF; ++i) print $i }'
14+
)
15+
ls -A | awk '/^\./' > $greylist
16+
#rm -f $delete
17+
echo "greylist is now:"
18+
cat $greylist
19+
echo
20+
echo "you may check and run the following:"
21+
echo "( cd $wd; rm -f $delete )"

date_minute.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# watch the date, accurate to the minute
3+
format="%-Y-%-m-%-d %-H:%M"
4+
5+
date +"$format"
6+
while [ $(date +%S) -ne 0 ]; do
7+
sleep 1;
8+
done
9+
while [ 0 ]; do
10+
date +"$format"
11+
sleep 60
12+
done

next_bus.pl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env perl
2+
# set stops to the bus stop numbers you like and buses to helpful bus numbers.
3+
4+
@stops = (2002, 2893);
5+
@buses = (4, 6, 106);
6+
7+
$buses = join "|",@buses;
8+
9+
$url = "http://www.edmonton.ca/portal/server.pt/gateway/PTARGS_0_0_341_239_0_43/http%3B/AppServer/ExternalSupported/Transit/BusStopSchedule_Results.aspx";
10+
11+
($date = `date +%Y+%b+%d`) =~ s/\n//;
12+
$hour = `date +%k` * 60;
13+
($minute = `date +%M`) =~ s/\n//;
14+
15+
foreach $stop (@stops) {
16+
open WGET, "wget --post-data='__EVENTTARGET=&__EVENTARGUMENT=&txtTravelDate=$date&cboHour=$hour&cboMinute=$minute&txtBusStopNumber=$stop&cmdBusStopScheduleSubmit=Get+Bus+Stop+Schedule' '$url' -O - |";
17+
$buf = "";
18+
while (<WGET>) {
19+
if (/(lblBusStopNumberLabel|lblDateOfTravelLabel|lblLocationLabel|lblDirectionLabel|lblDepartureDate)/) {
20+
/>([^<]*)<\//;
21+
$label = $1;
22+
} elsif (/(lblBusStopNumber|lblDateOfTravel|lblLocation|lblDirection)/ || /lnkRouteNumber/ && />($buses)</) {
23+
/>([^<]*)<\//;
24+
$buf .= "$label $1\n";
25+
}
26+
}
27+
print $buf
28+
}

rdptunnel.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
res=$(xdpyinfo | awk '/dimensions/ {print $2}' | awk -Fx '{print $1 "x" $2-24}')
4+
rdesktop -E -g$res localhost

set_env.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ alias grep="grep -n --color"
1818
alias rm="rm -i"
1919
alias psu="ps -U $USER"
2020
alias enscript="enscript -2rE"
21+
[ -f $HOME/scripts/set_env_local.sh ] && source $HOME/scripts/set_env_local.sh

set_env_local.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
alias matlab="matlab -nosplash -nodesktop -nojvm -r \"addpath('${HOME}/school/ee338/DSP')\""

setfans.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# set the fan speeds, or let the cpu take over again
3+
4+
# might need the next couple commands...
5+
# modprobe applesmc
6+
# echo applesmc | sudo tee -a /etc/modules
7+
8+
hddtemp /dev/sda
9+
sensors
10+
11+
if [ $# -lt 1 ]; then
12+
echo setting fans to auto...
13+
echo 0 > /sys/devices/platform/applesmc.768/fan1_manual
14+
echo 0 > /sys/devices/platform/applesmc.768/fan2_manual
15+
elif [ $1 -gt 6000 -or $1 -lt 2000 ]; then
16+
echo "speed must be in between 2000RPM and 6000RPM"
17+
exit 1
18+
else
19+
echo setting fans to $1...
20+
echo 1 > /sys/devices/platform/applesmc.768/fan1_manual
21+
echo $1 > /sys/devices/platform/applesmc.768/fan1_output
22+
echo 1 > /sys/devices/platform/applesmc.768/fan2_manual
23+
echo $1 > /sys/devices/platform/applesmc.768/fan2_output
24+
fi

0 commit comments

Comments
 (0)