16
|
Програмиране / Общ форум / Re: Mouse driver
|
-: Nov 02, 2012, 17:10
|
Ами напиши по точна спецификация, ако не искаш да е за X - прочети man страницата на gpm и ще видиш решението. А ако искаш да си напишеш програмка, която да го прави не виждам смисъл да е в ядрото (освен ако не искаш като упражнение), разгледай кода на gpm и виж какво/как чете и си напиши 1 малко демонче. GPM: git clone git://git.schottelius.org/gpm
|
|
|
18
|
Linux секция за напреднали / Хардуерни и софтуерни проблеми / Re: ipv6
|
-: Jun 11, 2012, 12:08
|
Ето според HE доставчиците от България, които обявяват v6 префикси и броят им. ASN Name Routes v6 ↓ AS8717 Spectrum NET Jsc 11 AS9070 ITD Network Bulgarian ISP 6 AS34224 Neterra Ltd. 5 AS9127 NETISSAT 4 AS12615 Global Communication Net Plc 4 AS5421 Sofia University 2 AS28898 Evrotur Sat TV 2 AS8262 Lirex net EOOD 2 AS31250 Online Direct Ltd. 1 AS39251 Netguard Ltd 1 AS6802 NREN - Bulgaria 1 AS43561 NET1 Ltd. 1 AS12716 MOBILTEL AD 1 AS42459 Fiber Optics Bulgaria OOD 1 AS43205 Bulsatcom AD 1 AS39505 VESTITEL BG JSC 1 AS47748 Daticum JSC 1 AS41313 "Novatel" Eood 1 AS51605 XS Soft JSCo 1 AS13124 Blizoo Media and Broadband EAD 1 AS8808 INTECH 1 AS43650 Spotify Technology SARL 1 AS16154 Telecoms-Net Ltd. 1 AS13172 Natsionalna Elektricheska Kompania EAD 1 AS41352 D. A. Tsenov Academy of Economics 1 AS12591 Smartcom Bulgaria AD 1 AS48155 University of Rousse "Angel Kanchev" 1 AS12867 BULGARIA ONLINE 1 AS48622 AITNET Ltd. 1 AS24693 CNSYS PLC 1 AS8866 Bulgarian Telecommunication Company Plc. 1
По принцип ако нямаш v6 мрежа, като се изчерпа v4 няма да може да поискаш една от финалните /22, които ще се раздават от последната /8 v4. От RIPE: According to section 5.6 of IPv4 Address Allocation and Assignment Policies for the RIPE NCC Service Region, when the RIPE NCC starts to allocate from the last /8, each Local Internet Registry (LIR) can receive only one /22 (1,024 IPv4 addresses) upon application for IPv4 resources. In order to obtain this /22 allocation, the LIR must already have an IPv6 allocation. No new IPv4 Provider Independent (PI) space will be assigned.
При нас поне от няколко месеца вече има пуснати тестови крайни клиенти на v6, които работят без проблеми. ( http://IPv6.onlineDirect.bg/)
|
|
|
19
|
Програмиране / Общ форум / Re: POSIX threads reader-writer lock
|
-: May 09, 2012, 11:24
|
От "man pthread_rwlock_wrlock" на FreeBSD: IMPLEMENTATION NOTES To prevent writer starvation, writers are favored over readers.
Това важи и за другите BSD-та (поне OpenBSD и NetBSD със сигурност). От "man pthread_rwlock_wrlock" на Solaris: Writers are favored over readers of the same priority to avoid writer starvation. See pthread_rwlock_rdlock(3C).
Интересното в ман страницата на Линукс е следното: ... Implementations [b]may[/b] favor writers over readers to avoid writer starvation. ... APPLICATION USAGE Applications using these functions may be subject to priority inversion, as discussed in the Base Definitions volume of IEEE Std 1003.1-2001, Section 3.285, Priority Inversion. ...
Бих казал, че по пътя на логиката, а и на книгите за ОС, би трябвало writer-а да е с по висок приоритет от reader-ите и да не може нови reader-и да я вземат когато writer се опитва да я заключи (което е и по важно), иначе при много нишки ще има write-starvation със сигурност. Поздрави
|
|
|
21
|
Нетехнически теми / Идеи и мнения / Re: Windows VS FreeBSD за реализация на Hotspot Radius Server
|
-: Jun 13, 2011, 13:53
|
Защо всички си мислите, че firewall-а на Windows server е много по назад от този на Линукс (функционалността, която ще ви трябва за подобен проект я притежава със сигурност) ? Или защо мислите, че този въпросен Windows няма да е стабилен или няма да работи ? Всичко това зависи от човека, който го прави и ползва, ето ви малко интересна информация - имам Windows server 2003 с radius на него за аутентикация, който има година и половина uptime, настроен firewall и аутентикира около 15 000 човека общо, естествено активните са по малко в даден момент. Има си настроен RAID и всякакви други методи за избягване на downtime и redundancy. П.С. Е чак да съм обил рибата, едва ли..... Не виждам значение дали е на FreeBSD или някоя друга дистрибуция на Linux..... ако има ще е по малко в конфигурационните файлове и до там.... лесното е че в портовете на FreeBSD имах всичко нужно да си направя системата, а и малко по добре познавам FreeBSD от другите.
Благодаря за мненията ....
В това изказване има импликация, че FreeBSD е Линукс дистрибуция, а то не е.
|
|
|
23
|
BSD секция / Настройки на софтуер / Re: ipfw настройки против DoS Flood
|
-: Mar 22, 2011, 03:38
|
Според мен става дума за BSD firewall и Windows s web server зад него, най - лесното, което можеш да направиш с ipfw е да ограничиш броя на връзките на IP address. Като естествено това ти прецаква хора с нат и тем подобни.Друг вариант е да имаш нещо, което следи лога и при много заявки за малко време вкарва адреса в черен списък за някакъв период. А иначе за 1-вото решение от man ipfw: limit {src-addr | src-port | dst-addr | dst-port} N The firewall will only allow N connections with the same set of parameters as specified in the rule. One or more of source and destination addresses and ports can be specified. Currently, only IPv4 flows are supported.
Example: ipfw add 500 allow tcp from any to XXX.XXX.XXX.XXX 80 limit src-addr 3 За останалото - Google ;-) Поздрави
|
|
|
25
|
BSD секция / Системни настройки / Re: Проблем с bridge между wire и wireless интерфейси
|
-: Mar 17, 2010, 18:25
|
От това, което човека е написал и дал като конфигурация: xl0 - WAN #1 (X.X.X.X/23) rl0 - WAN #2 (192.168.1.0/24) --------------------------- rl1 - LAN #1 \ >bridge0(192.168.0.0/24,192.168.2.0/24,monitor flag=>"[b]No packets are transmitted[/b]") / wlan0 - WLAN #1
Мрежите са наред, а monitor не е просто излишен, той спира трафика на бриджа. PS: За любопитните - if_ethersubr.c -> ether_output() if (ifp->if_flags & IFF_MONITOR) senderr(ENETDOWN);
|
|
|
27
|
Сигурност / Системна Сигурност / Re: CLOSE_WAIT apache не се затварят
|
-: Jul 07, 2009, 14:45
|
Първо един цитат от man 4 tcp: maxtcptw When a TCP connection enters the TIME_WAIT state, its associated socket structure is freed, since it is of negligible size and use, and a new structure is allo- cated to contain a minimal amount of information nec- essary for sustaining a connection in this state, called the compressed TCP TIME_WAIT state. Since this structure is smaller than a socket structure, it can save a significant amount of system memory. The net.inet.tcp.maxtcptw MIB variable controls the maxi- mum number of these structures allocated. By default, it is initialized to kern.ipc.maxsockets / 5.
nolocaltimewait Suppress creating of compressed TCP TIME_WAIT states for connections in which both endpoints are local.
fast_finwait2_recycle Recycle TCP FIN_WAIT_2 connections faster when the socket is marked as SBS_CANTRCVMORE (no user process has the socket open, data received on the socket can- not be read). The timeout used here is finwait2_timeout.
finwait2_timeout Timeout to use for fast recycling of TCP FIN_WAIT_2 connections. Defaults to 60 seconds.
Освен това при мен се получава, така че да не освобождава тези CLOSE_WAIT компресирани връзки и да се натрупват до над 60 000 (на 1 машина). Честно казано не съм търсил къде е проблема, но за бързо решение драснах един малък модул, който просто изчиства всички _компресирани_ връзки в CLOSE_WAIT в момента на зареждане, след което проблема при мен се оправя и започват отново да си изтичат нормално. Може да си направиш скрипт, който да следи за броя на висящи връзки в CLOSE_WAIT например. Същия проблем имам и под FreeBSD 7.x. Този модул е за 6.x. Ето модула ако мислиш, че ще ти е полезен: http://93.152.160.252/tcpclean.tar.gzmake kldload ./tcpclean.ko kldunload tcpclean
Друг вариант може би е tcpdrop man tcpdrop
|
|
|
28
|
BSD секция / Настройки на хардуер / Re: Freebsd Въпрос за процесор
|
-: Apr 06, 2009, 11:11
|
A wild guess. man cpufreq ... SYSCTL VARIABLES These settings may be overridden by kernel drivers requesting alternate settings. If this occurs, the original values will be restored once the condition has passed (e.g., the system has cooled sufficiently). If a sysctl cannot be set due to an override condition, it will return EPERM.
The frequency cannot be changed if TSC is in use as the timecounter. This is because the timecounter system needs to use a source that has a constant rate. The timecounter source can be changed with the kern.timecounter.hardware sysctl. Available modes are in kern.timecounter.choice sysctl entry.
dev.cpu.%d.freq Current active CPU frequency in MHz.
dev.cpu.%d.freq_levels Currently available levels for the CPU (frequency/power usage). Values are in units of MHz and milliwatts.
dev.DEVICE.%d.freq_settings Currently available settings for the driver (frequency/power usage). Values are in units of MHz and milliwatts. This is helpful for understanding which settings are offered by which driver for debugging purposes.
debug.cpufreq.lowest Lowest CPU frequency in MHz to offer to users. This setting is also accessible via a tunable with the same name. This can be used to disable very low levels that may be unusable on some sys- tems.
debug.cpufreq.verbose Print verbose messages. This setting is also accessible via a tunable with the same name. ...
|
|
|
29
|
BSD секция / Настройки на софтуер / Re: Skype on FreeBSD 7.x - Проблем
|
-: Apr 02, 2009, 12:30
|
sysctl compat.linux.osrelease sysctl kern.version Аз съм имал същия проблем под FreeBSD 7.0 с linux емулация на 2.6 ядро. В FreeBSD 7.1 емулацията на 2.6 е подобрена (дори флаш върви сравнително добре) и скайп върви нормално. Аз съм тествал linux_base-f8 с 2.6 емулация и всичко върви (въпреки, че мразя скайп и флаш, обикновено ги махам и двете ). Поздрави.
|
|
|
30
|
BSD секция / Настройки на софтуер / Re: kldload error
|
-: Mar 13, 2009, 02:44
|
sysctl kern.securelevel man security ...
The kernel runs with five different security levels. Any super-user process can raise the level, but no process can lower it. The security levels are:
-1 Permanently insecure mode - always run the system in insecure mode. This is the default initial value.
0 Insecure mode - immutable and append-only flags may be turned off. All devices may be read or written subject to their permissions.
1 Secure mode - the system immutable and system append-only flags may not be turned off; disks for mounted file systems, /dev/mem and /dev/kmem may not be opened for writing; /dev/io (if your platform has it) may not be opened at all; kernel modules (see kld(4)) may not be loaded or unloaded.
2 Highly secure mode - same as secure mode, plus disks may not be opened for writing (except by mount(2)) whether mounted or not. This level precludes tampering with file systems by unmounting them, but also inhibits running newfs( while the system is multi- user.
In addition, kernel time changes are restricted to less than or equal to one second. Attempts to change the time by more than this will log the message ``Time adjustment clamped to +1 second''.
3 Network secure mode - same as highly secure mode, plus IP packet filter rules (see ipfw(, ipfirewall(4) and pfctl() cannot be changed and dummynet(4) or pf(4) configuration cannot be adjusted. ...
Ако ти е над 0, може това да е причината, което означава, че вероятно някой скрипт при стартиране ти вдига левела. Поздрави.
|
|
|
|