Iam8up Blog

linux

Autojoin invite channels or multiple connect commands with Xchat

by iam8up on Feb.24, 2010, under geeky, linux, windows

Open the network list and on the server you want to do multiple commands with, specify the connect command

/LOAD -e .\profile\somecommands.txt

Then in somecommands.txt

/msg thebot !join foo bar
/timer 8 join #firstchaninvite
/timer 8 join #topsecret

For me I am start xchat with

xchat.exe -d ".\profile"

making the profile directory easy. By default it’s either in ~/.xchat2 or “%appdata%\X-Chat 2″.

Leave a Comment more...

Create Pseudo-FDX links with one Routerboard

by iam8up on Feb.01, 2010, under mikrotik

*Create bridge1
*Create fakebridge
*Create eoip-tunnel1
*Put eoip-tunnel1 and ether1 in bridge1
*Assign the four IPs in the diagram to their respective interfaces
*Set bridge or station modes – get the two wireless links up; make life easier by connecting wlan1 to wlan1 and wlan2 to wlan2; use radio-name to identify them
*OSPF on primary side

/routing ospf set redistribute-connected=as-type-1 router-id=172.31.254.1
/routing ospf interface add cost=100 interface=wlan1
/routing ospf network add area=backbone network=172.31.254.0/24
/routing ospf network add area=backbone network=172.31.255.0/24

*OSPF on secondary side

/routing ospf set redistribute-connected=as-type-1 router-id=172.31.254.2
/routing ospf interface add cost=100 interface=wlan2
/routing ospf network add area=backbone network=172.31.254.0/24
/routing ospf network add area=backbone network=172.31.255.0/24

SRC: http://blog.butchevans.com/2008/10/using-ospf-to-create-full-duplex-behaviour-for-wireless-links/

Leave a Comment more...


Take your Linux box’s temperature

by iam8up on Oct.15, 2009, under linux

yum install lm_sensors
#or
sudo apt-get install lm-sensors

sensors-detect
#or
sudo sensors-detect

Now at the end of this command it will explain the configuration necessary and even do it for you. Next modprobe the modules you need or reboot.

Then issue the command sensors and you will get your data! Here is my example:

$ sensors
lm86-i2c-0-4c
Adapter: SMBus I801 adapter at 1880
M/B Temp: +30°C (low = +0°C, high = +70°C)
CPU Temp: +50.9°C (low = +0.0°C, high = +70.0°C)
M/B Crit: +85°C (hyst = +75°C)
CPU Crit: +85°C (hyst = +75°C)

smsc47m1-isa-0800
Adapter: ISA adapter
fan1: 1834 RPM (min = 640 RPM, div = 8)
fan2: 1920 RPM (min = 640 RPM, div = 8)

SRC: This great post here http://www.cyberciti.biz/faq/howto-linux-get-sensors-information/

Leave a Comment more...

RB450 fiber speed test

by iam8up on Oct.06, 2009, under mikrotik

450fiber

This TCP test is actually an RB750. It should be the same same as the 450 as they’re using the same CPU and both are 100Mbit NICs.


Now if I had this between my network and Level 3…

Leave a Comment more...

Fixing yum error “rpmdb: unable to join the environment”

by iam8up on Oct.02, 2009, under linux

Error is something like

rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db3 – Resource temporarily unavailable (11)

#Remove Old Lock Files running this command:
rm -f /var/lib/rpm/__db*
#Now you have to rebuild RPM database:
rpm -vv –rebuilddb

http://sysadmingear.blogspot.com/2008/08/how-to-fix-rpmdb-unable-to-join.html

Leave a Comment more...


MikroTik template to replace your Linksys

by iam8up on Sep.05, 2009, under mikrotik

#basic stuff for all mt devices

/tool graphing set store-every=5min /tool graphing interface add allow-address=0.0.0.0/0 disabled=no interface=all store-on-disk=yes /tool graphing queue add allow-address=0.0.0.0/0 allow-target=yes disabled=no simple-queue=all \ store-on-disk=yes /tool graphing resource add allow-address=0.0.0.0/0 disabled=no store-on-disk=yes /system ntp client set enabled=yes mode=unicast primary-ntp=192.5.41.41 secondary-ntp=0.0.0.0 /system clock set time=12:00:00 date=Nov/11/2008 time-zone-name=America/New_York /ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \ max-udp-packet-size=512 primary-dns=208.67.222.222 secondary-dns=\ 208.67.220.220 /ip firewall filter add action=drop chain=input comment="blocks incoming dns queries" disabled=no \ dst-port=53 protocol=udp in-interface=ether1

#assuming your wan provides dhcp

/ip dhcp-client add interface=ether5 use-peer-ntp=yes use-peer-dns=yes

#gets the wlan1 working
#this puts your wlan1 and ether1 to ether4 in a rstp bridge

/interface wireless set wlan1 mode=ap-bridge band=2.4ghz-b/g frequency=2462 \ ssid=MyHomeNetwork disabled=no /interface bridge add name=bridge-lan protocol-mode=rstp /interface bridge port add bridge=bridge-lan interface=wlan1 /interface bridge port add bridge=bridge-lan interface=ether1 /interface bridge port add bridge=bridge-lan interface=ether2 /interface bridge port add bridge=bridge-lan interface=ether3 /interface bridge port add bridge=bridge-lan interface=ether4

#add ip address to bridge

/ip address add interface=bridge-lan address=172.16.16.1/24

#masq the bridge network

/ip firewall nat add action=masquerade chain=srcnat comment="masq bridge lan" disabled=no out-interface=\ ether5 src-address=172.16.16.0/24

#add dhcp server to bridge

/ip pool add name=dhcp_pool1 ranges=172.16.16.100-172.16.16.199 /ip dhcp-server add address-pool=dhcp_pool1 authoritative=after-2sec-delay bootp-support=\ static disabled=no interface=bridge-lan lease-time=1d name=dhcp1 /ip dhcp-server config set store-leases-disk=5m /ip dhcp-server network add address=172.16.16.0/24 comment="" dns-server=172.16.16.1,4.2.2.2 gateway=\ 172.16.16.1
Leave a Comment more...

Failover connections using route distance

by iam8up on Sep.01, 2009, under mikrotik

This guide is using one connection in which the IP is obtained through the dhcp-client and a second one is static. It can easily be modified for two static IPs or two dhcp-client addresses. The guide uses static route distances to determine which to use. It works for my customer but your mileage may vary.

Start by making sure you can use both interfaces to route out. You’ll need to add the static information and the dhcp-client. Simply disable the default gateway of one or the other, then vice versa to confirm you’re able to correctly use both when the other is unused. I suggest a ping test to 4.2.2.2 after route changes.

If not done already, be sure to document both public IPs. Be aware you may be able to use safe mode if you’re careful. Hit Control+X in the terminal window to enter and leave safe mode. If connectivity is lost to the router, any commands issued during safe mode are undone. You can save these commands by exiting and re-entering the terminal window as often as you wish.

Assuming you’re doing NAT make sure you do masquerade rules for both or all outgoing interfaces:

/ip firewall nat add action=masquerade chain=srcnat comment=”masquerade-lan-network” disabled=no src-address=192.168.1.0/24

Set the dhcp-client to a distance of 5 – this feature was added in 3.11:

/ip dhcp-client set etherX default-route-distance=4

Set the static default gateway to a distance of 10:

/ip route set [find dst-address=0.0.0.0/0] distance=9

Now it should look like this:

[jluthman@hisawesomecustomer] > ip route pr Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit # DST-ADDRESS PREF-SRC G GATEWAY DISTANCE IN.. 0 S 0.0.0.0/0 r 2.2.2.2 10 et.. 1 ADS 0.0.0.0/0 r 1.1.1.1 5 et.. 2 ADC 10.0.0.0/24 10.0.0.1 0 et..

Now make sure you are using the primary connection. Confirm you are on this network with a traceroute. You will now add one final static route that the netwatch tool will utilize to deterimine if the connection is down, through a ping test.

/ip route
add comment=”FORCE FOR PRIMARY CONNECTION TEST” disabled=no \
gateway=1.1.1.1 distance=1 dst-address=4.2.2.1/32

Add this netwatch script:

/tool netwatch
add host=4.2.2.1 interval=30s timeout=1s

Add this for up:

/ip route set [find distance=4] distance=10
:log error “main route is up”
/ip firewall connection remove [find]

and down:

/ip route set [find distance=10] distance=4
:log error “main route is DOWN”
/ip firewall connection remove [find]

From this point on, through your static route to 4.2.2.1 it will only use the gateway specified (that is from the primary connection). If this ping fails even once, it will perform the down section – changing the distance of your static IP route from 10 to 4, making it closer then the dhcp-client route of 5. The final command in both up and down sections erases the current connections as needed if you’re running NAT (masquerading). Note that the ping test will continue to run while on the down condition, once again through the 4.2.2.1/32 static route.

For alternative or more complicated MikroTik assistance join the mailing list or ask Butch Evans

1 Comment more...


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...