Custom Search

Friday, December 24, 2010

End of the Year Hodge-Podge

Put off upgrading way too long. As to how long, I’m embarrassed
to say. Previously I could pretty much get things how I wanted
in a couple of days, even after doing a new install and getting
all my old stuff back in. This time it took a couple of weeks to
really get where I wanted to be with the system. Not keeping up
with changes can bite one in the butt.

I’ve got a Linksys WRT54G-TM router running DD-WRT v24-sp2
firmware. Got an account at Hurricane Electric and if you
have got IPv6 working already, http://ipv6.he.net/. Also
have an account at DynDNS.com for when my ISP changes the
IP address on my cable modem and a hostname that synchronizes
with it so I can reach home when I’m traveling. I setup a
VPN too, and am now able to surf through it no matter where
I’m connected at. Good for for instance, we go to B&N a lot
and they’ve got free Wifi. I connect to them, then activate
the the connection to my home VPN. Works great so far. Just
wish I’d figure out how to get IPv6 to work on the it. The
router does DHCP for my LAN and I’ve got it set to give the
same IP address to each box each time. Makes things easier
on me moving and copying files around the LAN. Ran into a
problem with my browser on a lot of IPv6 sites, where they’d
revert to IPv4 or not load at all. I had missed the option
mentioned in the man page ‘family inet6 inet4′ which sets
the preference to IPv6 as it’s first. When you use DHCP to
assign addresses, each time a box boots and starts the network,
/etc/resolv.conf gets overwritten. If you have some settings
you want in it like I did, you get around the overwrite
problem by putting the options in /etc/resolv.conf.tail and
then they show up in resolv.conf okay. Also had added some
stuff to /etc/pf.conf so icmp would be passed, as they’re
required for IPv6 to work right on my tunnel.

#Under the macros section:
icmp_types=”{ echoreq, echorep, unreach }”

#Under the rules section:
pass inet proto icmp all icmp-type $icmp_types
pass inet6 proto icmp6

***********************************************************

Fiddled around with tmux quite a bit, trying to get it configured
the way I need it. Hadn’t used it in a while and had forgotten quite
a bit. My setup is not real complicated, I just had problems with
how I was calling the program. Here’s my .tmux.conf:

# Default global options.
set status-bg yellow
set status-fg black
set default-command “exec /bin/ksh -l”
set -g status-right ‘%a %m/%d/%y %H:%M’
set -g status-interval 5
set bell-action current
set history-limit 2000

# Prefix key.
unbind C-b
set -g prefix C-s

# Keys to switch session.
bind q switch -t0
bind Q switch -t0
bind w switch -t1
bind W switch -t1
bind -r C-n next-window
bind -r C-p previous-window
bind ‘”‘ choose-window

# Other key bindings.
bind i list-windows
bind I list-windows
bind ‘-’ split-window -dv
bind ‘|’ split-window -dh
bind “‘” new-window
bind < resize-pane -L 1
bind > resize-pane -R 1
bind _ resize-pane -D 1
bind u resize-pane -U 1

# Session Initialization

# First Session.

new -d -s0 -nmain1

neww -d -nmutt
neww -d -nwork1
splitw -v -p 50 -t 2
splitw -h -p 50 -t 2
neww -d -nwork2
splitw -h -p 50 -t 3
neww -d -nnet
selectw -t 0

# Second Sesson.

new -d -s1 -nmain2
neww -d -nshell1
splitw -v -p 50 -t1
neww -d -nshell2
splitw -v -p 50 -t2
neww -d -nshell3
splitw -v -p 50 -t3
selectw -t 0

Lot of split panes and stuff there I probably don’t need,
but I needed to know how to do it, so I just did some
experimenting with it. Put a few aliases in ~/.kshrc:

alias tm0=’tmux attach-session -t 0′
alias tm1=’tmux attach-session -t 1′
alias tmk=’tmux kill-server’

***********************************************************

Side note while I’m thinking of it. Never had the occasion
to pipe anything to vim before. Started wondering how to
do it. Here’s how:

$ cat file.txt | vim -

***********************************************************

I built the gimp, sane-frontends, and sane-backends the other
day. I expected to have an ‘Acquire’ choice in the gimp menu
but it wasn’t there. Then my buddy in the local LUG reminded
me to install xsane. The gimp no longer has the ARG to build
it with mmx, but I had to put some extra switches on the make
command when I built

$ cd /usr/ports/graphics/sane-frontends/
sudo env FLAVOR=”gimp” make install

$ cd ../sane-backends/
sudo make -D --with-gphoto install

$ cd ../xsane/
sudo env FLAVOR=”gimp” make install

***********************************************************

Got tired of the nag on the console about clamav being out of
date. I had installed the package for 4.8 release, 0.96.1 which
was causing the nag. Uninstalled latest version, 0.96.4 and
built it. Seemed like it took a lot longer than it did with
previous versions, but it built and installed okay. That
version didn’t last long. Uninstalled it, then built 0.96.5
on 20101214. Built and installed okay. Just a pain in the butt
with the clamav uid and gid thing. Old version used _clamav.
Last few versions want clamav. You can change it using the
following to avoid the error when running ./configure:

sudo ./configure –with-group=_clamav –with-user=_clamav

***********************************************************

Have never used irc extensively but taught myself enough to
know how to configure and get around in irssi. Installed silc
which is supposed to be more secure than regular irc and is
built around irssi. Including some notes here on how I was
able to connect to a silc server over tor:

1) If you haven't done so already, install tor and socat 2) Start /usr/local/bin/tor which defaults to port 9050

*Side Note on tor*
To run it all the time you can start it in /etc/rc.local at
boot time:

fi

if [ -x /usr/local/bin/tor ]; then
echo -n ‘ starting tor’;
/usr/local/bin/tor
fi

3) Now run this command as root or with sudo:
socat TCP4-LISTEN:706,bind=localhost,range=127.0.0.1/32,fork \
SOCKS4A:127.0.0.1:silc.silcnet.org:706,socksport=9050 > socat_log.$$ 2>&1 &

4) Start silc

5) After entering password and silc is running:
/connect 127.0.0.1 706

A bit slower than a regular connection but much more secure
since your real IP address isn’t visible.

Labels: , , , , , , , , ,

Sunday, August 23, 2009

Passive Aggressive Spam Filtering

Passive Aggressive Spam Filtering: "

Using OpenBSD and spamd for spam filtering and grey-listing is very old news but there are a few situations where it becomes politically and technically challenging to run in production. Here was a simple yet (and in no way the best method) of using PF and some friends on the internet to help 'slow the flow' of offal from the Internet into your mail server.

Read more..."

Labels: , ,

Saturday, May 31, 2008

Recent Web Site Updates

I finally got a couple of pages up I'd been wanting to
despite a bunch of interruptions. One is on installing
and configuring Conky to display system info on your
desktop. It also shows how to pull in other information
like weather reports and some system info that I couldn't
get with Conky's regular functions, due to either my own
misunderstanding of the instructions, or else something in
my chipset that's incompatible with the program. Probably
some of both.

ADDENDUM: 2008-06-06
Pertaining to Conky above, I've added some info to the page
that shows how I'm now getting stock market data to display.

ADDENDUM: 2008-06-13
Again, pertaining to Conky above, added some info on how I
kludged together a script to filter out my daily Accuweather
forecast email message, format it and scp it from that box to
the box I'm using conky on to be displayed below the current
conditions feed I get from NOAA's weather site.

The other write up is on creating a file to be used as a
persistent table for OpenBSD's PF packet filter firewall,
how to automatically concatenate IP addresses of would
be intruders to the file using scripts that run on a schedule
from a cronjob, and then flush the one table that does the
collecting and reload the persistent file back into its own
table. This makes it truly persistent, since rebooting has no
effect. You don't have to start back all over again with loads
of intrusion attempts in your logs.The pages are at:

Conky
PF with a Cumlative Table

ADDENDUM: 2008-07-04
Again I've added some more to the conky article above.
This addition describes how I run 2 instances of conky
and change one of them depending on the time of day and
the day of the week, since one configuration uses stock
market data and weather, while the other for the times
when the market is closed just displays the weather.
The change is accomplished using 2 short shell scripts
and 2 cronjobs. The last part of the entry shows how I
clean stale values from the environment in case I close
X but don't log out of the system, and then restart X.
From the value that gets exported from .xinitrc conky
determines which configuration file to use by comparing
that value with a small text file containing appropriate
times to load the file with stock market data. If it's
after hours or on the weekend when X restarts, it loads
just the weather version of conky on the one side of the
screen. The other conky running on the right side of the
screen doesn't change. It always shows system information.

Labels: , , , , , ,