root@pruebas:/root # diff -u /usr/src/sys/kern/subr_autoconf.c-defecto /usr/src/sys/kern/subr_autoconf.c
--- /usr/src/sys/kern/subr_autoconf.c-defecto 2012-10-10 13:51:27.000000000 +0200
+++ /usr/src/sys/kern/subr_autoconf.c 2012-10-10 18:21:51.000000000 +0200
@@ -133,16 +133,17 @@
/* Block boot processing until all hooks are disestablished. */
mtx_lock(&intr_config_hook_lock);
warned = 0;
- while (!TAILQ_EMPTY(&intr_config_hook_list)) {
+ /* while (!TAILQ_EMPTY(&intr_config_hook_list)) { */
if (msleep(&intr_config_hook_list, &intr_config_hook_lock,
0, "conifhk", WARNING_INTERVAL_SECS * hz) ==
EWOULDBLOCK) {
+ printf("\n\n SARENET Individual lock name antes de unlock es : %s", intr_config_hook_lock.lock_object.lo_name);
mtx_unlock(&intr_config_hook_lock);
warned++;
run_interrupt_driven_config_hooks_warning(warned);
mtx_lock(&intr_config_hook_lock);
}
- }
+ /* } */
mtx_unlock(&intr_config_hook_lock);
}TAILQ_EMPTY is at queue.h :
#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
wtorek, 22 października 2013
FreeBSD 9.2 XEN xenbusb_nop_confighook_cb
Recently I tried run FreeBSD 9.2 on my Citrix Xen machine with HVM support.
After booting I got error:
xenbusb_nop_confighook_cb
This error got me confused. I'd searched awhile and found solution :
http://web.archiveorange.com/archive/v/jbzpKsnhTPhFFEuQuYTP
Etykiety:
citrix,
freebsd 9.2,
vm,
xen,
xenbusb_nop_confighook_cb
środa, 16 października 2013
Columbus day
Special offer from Packt Publishing - all books 50% off has been extended to 21 October 2013 - that's great news
http://bit.ly/1bqvB29
http://bit.ly/1bqvB29
Etykiety:
books,
columbus day,
packtpub,
special offer
środa, 9 października 2013
Postgresql replication book review
http://www.packtpub.com/postgresql-replication/book
Recently I got book about postgresql replication for review .
This book is great.
It describes different replication methods available in postgres in very easy way.
Besides that, it describes how replication mechanisms work, what you should know about designing database and many other aspects related to databases.
The book contains examples which can be used to one's practice.
In this book there are usefull things not only for database administrator but also for regular user who wants to know better how it works.
Recently I got book about postgresql replication for review .
This book is great.
It describes different replication methods available in postgres in very easy way.
Besides that, it describes how replication mechanisms work, what you should know about designing database and many other aspects related to databases.
The book contains examples which can be used to one's practice.
In this book there are usefull things not only for database administrator but also for regular user who wants to know better how it works.
Etykiety:
book,
postgresql,
replication
poniedziałek, 7 października 2013
Read linux dmesg with date
Simple script to read dmesg from linux (contains real date no miliseconds)
----------------------------------------------------------------------------------------------------------
#!/usr/bin/python
import sys
import re
import time
import datetime
import fileinput
import os
try:
uptime = open('/proc/uptime','r')
except IOError as (errno, strerror):
print "Wystapil blad otwarcia pliku :\n %s\n" % (strerror)
czas = time.time()
uptime_seconds = czas-float(uptime.readline().split()[0])
p = os.popen('dmesg')
for line in p.readlines():
re1='.*?'
re2='(\\d+)'
re3='(\\.)'
re4='(\\d+)'
rg = re.compile(re1+re2+re3+re4,re.IGNORECASE|re.DOTALL)
m = rg.search(line)
if m:
int1=float(m.group(1)+m.group(2)+m.group(3))
szukaj=(m.group(1)+m.group(2)+m.group(3))
czas = uptime_seconds + int1
czas = datetime.datetime.fromtimestamp(int(czas)).strftime('%Y-%m-%d %H:%M:%S')
zwrot = re.sub(szukaj,czas,line.rstrip(),1)
print zwrot
----------------------------------------------------------------------------------------------------------
#!/usr/bin/python
import sys
import re
import time
import datetime
import fileinput
import os
try:
uptime = open('/proc/uptime','r')
except IOError as (errno, strerror):
print "Wystapil blad otwarcia pliku :\n %s\n" % (strerror)
czas = time.time()
uptime_seconds = czas-float(uptime.readline().split()[0])
p = os.popen('dmesg')
for line in p.readlines():
re1='.*?'
re2='(\\d+)'
re3='(\\.)'
re4='(\\d+)'
rg = re.compile(re1+re2+re3+re4,re.IGNORECASE|re.DOTALL)
m = rg.search(line)
if m:
int1=float(m.group(1)+m.group(2)+m.group(3))
szukaj=(m.group(1)+m.group(2)+m.group(3))
czas = uptime_seconds + int1
czas = datetime.datetime.fromtimestamp(int(czas)).strftime('%Y-%m-%d %H:%M:%S')
zwrot = re.sub(szukaj,czas,line.rstrip(),1)
print zwrot
środa, 2 października 2013
MongoDB aggregation
MongoDB aggregation examples:
db.posts.aggregate({$unwind:"$comments"},{$group:{_id:"$comments.author",count:{$sum:1}}},{$sort:{count:1}})
db.zip.aggregate([{$match:{$or:[{state:"CA"},{state:"NY"}]}}, {$group:{_id:{city:"$city",state:"$state"}, pop:{$sum:"$pop"}}}, {$match:{pop:{$gt:25000}}}, {$group:{_id:"$state", average:{$avg:"$pop"}}}])
db.grades.aggregate({$unwind:"$scores"} , {$match:{"scores.type":{$nin:["quiz"]}}},{$group:{_id:{student_id:"$student_id",class_id:"$class_id"},avg:{$avg:"$scores.score"}}},{$group:{_id:"$_id.class_id",average:{$avg:"$avg"}}})
db.zip.aggregate( [ {$project : {city:{$substr:["$city",0,1]},pop:1}}, {$sort : {city : 1}}, {$match: {city: /^\d.*$/}} , {$group:{_id:1,pop:{$sum:"$pop"}}}])
Etykiety:
aggregation,
databases,
mongodb
czwartek, 19 września 2013
Create "internal" VLAN for Xen Virtual Machines
1) Add the dummy interface driver to the auto-load modules:
2) Configure network interface ( /etc/network/interfaces)
3) Bring up the dummy interface
4) Add line in : /etc/xen/xend-config.sxp
5) Run the command:
6) Check if pdummy interface is present:
8) Attach new interface to guest domain :
9) Log in to guest domain console and add new interface:
And add this to /etc/network/interfaces
10) In Dom0 edit DomU config and add ew interface:
i.e.: /etc/xen/example.domain.guest
11) Last thing is to set the ip_forwarding in the kernel of Dom0 and create NAT rules.
echo dummy >> /etc/modules
2) Configure network interface ( /etc/network/interfaces)
auto dummy0
iface dummy0 inet static
address 192.168.100.1
netmask 255.255.255.0
iface dummy0 inet static
address 192.168.100.1
netmask 255.255.255.0
3) Bring up the dummy interface
ifup dummy0
4) Add line in : /etc/xen/xend-config.sxp
(network-script 'network-bridge netdev=dummy0')
5) Run the command:
/etc/xen/scripts/network-bridge start netdev=dummy0 antispoof=no
6) Check if pdummy interface is present:
ifconfig pdummy0
pdummy0 Link encap:Ethernet HWaddr b6:a5:b4:35:a7:1a
inet6 addr: fe80::b4a5:b4ff:fe35:a71a/64 Scope:Link
UP BROADCAST RUNNING NOARP PROMISC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:532 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:28928 (28.2 KiB)
pdummy0 Link encap:Ethernet HWaddr b6:a5:b4:35:a7:1a
inet6 addr: fe80::b4a5:b4ff:fe35:a71a/64 Scope:Link
UP BROADCAST RUNNING NOARP PROMISC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:532 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:28928 (28.2 KiB)
8) Attach new interface to guest domain :
xm network-attach example.domain.guest bridge=dummy0 script=vif-bridge mac=00:16:3E:40:22:12
9) Log in to guest domain console and add new interface:
root@debian-xen:/home/shamrock# xm console example.domain.guest
Debian GNU/Linux 6.0 debian hvc0
debian login: root
Password:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian:~# ifconfig eth1 192.168.100.200 netmask 255.255.255.0
root@debian:~# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:40:22:12
inet addr:192.168.100.200 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe40:2212/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:608 (608.0 B) TX bytes:510 (510.0 B)
Interrupt:244
Debian GNU/Linux 6.0 debian hvc0
debian login: root
Password:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian:~# ifconfig eth1 192.168.100.200 netmask 255.255.255.0
root@debian:~# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:3E:40:22:12
inet addr:192.168.100.200 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::216:3eff:fe40:2212/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:608 (608.0 B) TX bytes:510 (510.0 B)
Interrupt:244
And add this to /etc/network/interfaces
auto eth1
iface eth1 inet static
address 192.168.100.200
gateway 192.168.100.1
netmask 255.255.255.0
iface eth1 inet static
address 192.168.100.200
gateway 192.168.100.1
netmask 255.255.255.0
10) In Dom0 edit DomU config and add ew interface:
i.e.: /etc/xen/example.domain.guest
vif = [ 'ip=212.85.34.12,mac=00:16:3E:0B:0A:83,bridge=eth0', 'ip=192.168.100.100,mac=00:16:3E:D7:9C:F6,bridge=dummy0' ]
11) Last thing is to set the ip_forwarding in the kernel of Dom0 and create NAT rules.
root@debian-xen:/# echo 1 >/proc/sys/net/ipv4/ip_forward
root@debian-xen:/# iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d 0.0.0.0/0 -j MASQUERADE
root@debian-xen:/# iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d 0.0.0.0/0 -j MASQUERADE
Etykiety:
interface,
internal interface,
linux,
xen,
xenserver
środa, 14 sierpnia 2013
FortiMail - diagnozowanie tcpdump
Do diagnozowania problemów związanych z siecią na serwerach z unixem służą wszelkiego rodzaju narzędzia pokroju tcpdumpa czy wiresharka.
Także Forti posiada takie narzędzie na poziomie CLI.
Składnia polecenia:
1: wypisuje nagłówek pakietu
2: wypisuje nagłówek pakietu i dane zwrotne z IP
3: wypisuje nagłówek i dane z pakietu ethernetowego ( jeżęli jest dostępny)
4: wypisuje nagłówek z nazwą interface
5: wypisuje nagłówek i dane z IP wraz z nazwą interface
6: wypisuje nagłówek i dane z pakietu ethernetowego ( jeżęli jest dostępny) wraz z nazwą interface
diagnose sniffer packet any ‘net 192.168.1.0/24 and host 172.16.11.12 and port 3878′
Także Forti posiada takie narzędzie na poziomie CLI.
Składnia polecenia:
diagnose sniffer packet {interface | all} ‘net z.z.z.z/p and/or host x.x.x.x and/or port yyy’ [options]W celu zawężenia poszukiwań można użyć
net/prefix : bierze pod uwagę cały blok IP
host : bierze pod uwagę tylko danego hosta
port : wypisuje tylko połączenia dla danego portu
options : dodatkowe opcje
host : bierze pod uwagę tylko danego hosta
port : wypisuje tylko połączenia dla danego portu
options : dodatkowe opcje
Pole
Dodatkowe opcje podawane są na końcu w postaci cyfry:The Options field at the end are as follow:1: wypisuje nagłówek pakietu
2: wypisuje nagłówek pakietu i dane zwrotne z IP
3: wypisuje nagłówek i dane z pakietu ethernetowego ( jeżęli jest dostępny)
4: wypisuje nagłówek z nazwą interface
5: wypisuje nagłówek i dane z IP wraz z nazwą interface
6: wypisuje nagłówek i dane z pakietu ethernetowego ( jeżęli jest dostępny) wraz z nazwą interface
diagnose sniffer packet any ‘net 192.168.1.0/24 and host 172.16.11.12 and port 3878′
Subskrybuj:
Posty (Atom)