Tue, 10 Aug 2010
Dmidecode - for pulling info about a box
Recently i had to pull info about a server and i had no urge to drive to the datacenter. After some searching on google i found a stray forum post about dmidecode. this program pulls a fair amount of info about hardware on a box.
posted at: 21:28 | Tags sysadmin, obscure, donotforget | path: /sysadmin | permanent link to this entry
Tue, 22 Dec 2009
poptop and iptables rules for nat
after setting up an instance of poptop vpn it was clearly necessary to nat traffic through the vpn. I used to the following to route traffic coming in from the ppp interface onto the local network interface.
iptables -A FORWARD -i ppp+ -o eth1 -m state --state NEW -j ACCEPT -s 192.168.30.0/24 iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A POSTROUTING -t nat -j MASQUERADE
i'm not certain if it actually helps but i do have ip forwarding enable in the kernel as well
echo "1" > /proc/sys/net/ipv4/ip_forward
then to enable it permenantly, set the following in /etc/sysctl.conf
net.ipv4.ip_forward =1
posted at: 19:39 | Tags pptp iptables nat vpn | path: /sysadmin | permanent link to this entry
Wed, 29 Jul 2009
The IN-N-OUT plate
BEHOLD.
The closest thing to garbage plate available at in n out burger. It consists of a flying dutchman on top of an order of animal style fries.
posted at: 04:42 | Tags plate, food, burger | path: /plate | permanent link to this entry
Sat, 25 Jul 2009
quick file transfer
needing to transfer a large in a reasonable amount of time, its time for quick and simple transfer with netcat.
Important thing to note, this is being done in a datacenter not over the internet.
First setup the server:
tar c directory | nc -w 10 -l 7878
then setup the client:
nc -w 10 server 7878 | tar -x
transfer times on this are roughly 100 mbs a second on a gigabit switch
posted at: 01:50 | Tags nc, fun, fast | path: /sysadmin | permanent link to this entry
Wed, 15 Jul 2009
a fun and bizarre problem with building an rpm
After building an rpm and tossing it into the local repo at work, an attempt to install it was made. Then the following awesome line reared its head.
Running rpm_check_debug python: rpmte.c:589: rpmteColorDS: Assertion `ix < Count' failed. zsh: abort sudo yum install splunkthis of course makes absolutely no sense. one could reference this picture in fact
.
I found the solution is adding the tag AutoReqProv: nofixed it.
posted at: 00:23 | Tags redhat rpm wtf | path: /sysadmin | permanent link to this entry
Tue, 05 May 2009
Vlans on a Cisco 7200 Router
In bringing up some new network gear putting a router's interface on a vlan was required. Sadly google was not readily forthcoming with this info. Also i readily acknowledge i could be bad at googling. So here is the info.
Step 1. log into router, enable and go to config terminal
Step 2. hit int FastEthernet 1/0.42 using all of your proper info
Step 3. assign the ip for this interface ip address your.ip.goes.here with.your.subnet.mask
Step 4. wherein the vlan is created, encapsulation isl 42 again using whatever is your correct info
After that the interface should be up and ready, check with 'show ip int brief'
posted at: 17:41 | Tags router cisco | path: /networking | permanent link to this entry
Tue, 31 Mar 2009
pxebooting on centos/rhel
Setting up pxebooting is simple and incredibly useful. To do so you need to install a dhcp server and a tftp server, and a dns server fairly nice in this situation as well.
So step 1, install a dhcp server
# yum install dhcp
configuration is fairly simple, a config like this is fine
ddns-update-style interim;
ignore client-updates;
option domain-name "example.domain";
subnet 10.0.42.0 netmask 255.255.255.0 {
range 10.0.42.20 10.0.42.250;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.0.42.1;
next-server 10.0.42.1; #ip of tftp server
filename "pxelinux.0"; #filename that will be grabbed from tftp
default-lease-time 3600;
max-lease-time 7200;
}
also a few notes on the dhcp config, next-server isnt explictly required if dhcp and tftp are on the same box, but it doesnt hurt to specify. Also dhcpd will only run on interfaces that are on dhcp hosted subnets.
Next up is installing and configuring tftp
install tftp with yum
# yum install tftp-server
this will also install xinetd, running tftp off this is simple, as is configuration
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
pretty much all that needs to be done here is the disable line to "no" from "yes"
now its just setting up files, copy pxelinux.0 from /usr/lib/syslinux/
# cp /usr/lib/syslinux/pxelinux.0 /tftpboot
note, /tftpboot will be created when you install tftp-server. At this point its a good idea to test your tftp setup.
tftp ip.of.server tftp> get pxelinux.0
now pxelinux config needs to be setup, create a directory called "pxelinux.cfg" and put a file inside called "default". default should look something like this:
prompt 1 default basic timeout 100 label basic kernel kernfile append initrd=initrd.img ramdisk_Size=9216
kernfile and the initrd.img mentioned in the config should be copied into /tftpboot . at this point its time to fire up a machine to test with, if things dont boot up , try testing with the dhcp options with scapy's dhcp_request function
posted at: 06:56 | Tags pxeboot centos | path: /sysadmin | permanent link to this entry
Mon, 30 Mar 2009
sentry gun mount
Out of boredom and hatred of raccoons getting into my i've started working on an airsoft sentry gun. The building of the mount is as follows.
WARNING: GIANT PICTURES TO FOLLOW
First I got a 1x8x6 plank of pine wood, 2 lazy susan mounts, 4 angle brackets and some spray paint.
Overall my plan is to have to points of movement, for this i needed 2 chunks of wood to mount the lazy susans on. For this i cut 2 6 inch long chunks of wood.
then i need a 10 inch piece for elevation to mount the gun platform and to allow for space to mount the second servo. Addtionally i need a 20 inch piece to mount the gun to, and then remainder of the wood is used as a base for the entire system
Next up is mount the lazy susans

Then mount the 10 inch piece to the base
posted at: 07:43 | Tags sentry | path: /sentrygun | permanent link to this entry
Wed, 17 Dec 2008
fun with diskspace
with in the span of about 8 hours i've run into two separate files not having their disk usage released. one a process was holding open and just needed a restart. the second was on a nas and the files had been deleted but the filesystem hadnt been synced, so running sync explictly was needed
so first hit lsof then try sync if rm isnt giving back space, then probably check for hard links if either of these didnt do it
posted at: 07:46 | Tags rm, mystery | path: /sysadmin | permanent link to this entry
Mon, 15 Dec 2008
Netmap - Django network map
At my current job we have no solid documentation of what ip's are in use and if any have been reserved for upcoming projects or have been taken as virtual or fallback ips. so my remmedy to this was to create a quick django app to record hosts and display available ips.
Netmap uses a cronjob running nmap to dump network info in to files in /tmp, after a file is recorded its parsed and logged, also the nmap scan should be run as a standard user. Ips displayed with the django app hold info regarding hostname, status, if the ip has been reserved, a generic note field, and which network the ip is on.
netmap.tar.gz
posted at: 07:33 | Tags networking mapping | path: /sysadmin | permanent link to this entry



