Заметки о Linux, системном администрировании, программировании, электронике и не только
26 апреля 2012
Links from the Web: Debian sources list generator
Debian sources list generator - I found interesting link while googling around. It can be very useful for those who migrating to Debian, or simply needed third-party software which not shipped with official distribution.
HOW-TO: Highly anonymous proxy with multiple ip support
Today I completed proxy-related task which looks unique for me. So I decide to write a small how-to to memorize steps and have ability to use it in future as reference.
The main difficulty in this task was a deprecated CentOS installation on server. If you try simply try to run
then yum will complain about absent repodata.xml - centos 4 repos already removed from CentOS mirrors and I need to configure vault.centos.org repo in YUM. So I backup /etc/yum.repos.d/CentOS-Base.repo and edit it:
Then I cleanup yum cache info and run search again
Now squid available for install, so installing it
Next step is to setup authentication. I use only BASIC auth, so I uncomment related lines in /etc/squid/squid.conf
Then I create file with password info:
Next step is to hide proxy info. After this step web sites lost ability to detect if you use proxy or not.
For this I added following lines in squid.conf
If you want to hide or spoof User-Agent, than replace last but one line to
The last step is to add ability to use multiple ip source address depending on proxy address currently used. For example if you use 192.168.17.43:3128 as proxy address then sites detect your ip address as 192.168.17.43.
For this I use file with ip list: one ip per line. Than I run script to generate config:
The last step is to reload squid conf and enable squid startup during system boot
To check proxy info you can visit this link.
The main difficulty in this task was a deprecated CentOS installation on server. If you try simply try to run
yum search squid
then yum will complain about absent repodata.xml - centos 4 repos already removed from CentOS mirrors and I need to configure vault.centos.org repo in YUM. So I backup /etc/yum.repos.d/CentOS-Base.repo and edit it:
[base] name=CentOS-4.8 - Base baseurl=http://vault.centos.org/4.8/os/$basearch/ gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-centos4 priority=1 protect=1 #released updates [update] name=CentOS-4.8 - Updates baseurl=http://vault.centos.org/4.8/updates/$basearch/ gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-centos4 priority=1 protect=1 #packages used/produced in the build but not released [addons] name=CentOS-4.8 - Addons baseurl=http://vault.centos.org/4.8/addons/$basearch/ gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-centos4 priority=1 protect=1 #additional packages that may be useful [extras] name=CentOS-4.8 - Extras baseurl=http://vault.centos.org/4.8/extras/$basearch/ gpgcheck=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-centos4 priority=1 protect=1 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-4.8 - Plus baseurl=http://vault.centos.org/4.8/centosplus/$basearch/ gpgcheck=1 enabled=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-centos4 priority=2 protect=1 #contrib - packages by Centos Users [contrib] name=CentOS-4.8 - Contrib baseurl=http://vault.centos.org/4.8/contrib/$basearch/ gpgcheck=1 enabled=1 gpgkey=http://vault.centos.org/RPM-GPG-KEY-centos4 priority=2 protect=1
Then I cleanup yum cache info and run search again
# yum clean all # yum search squid
Now squid available for install, so installing it
# yum install squid
Next step is to setup authentication. I use only BASIC auth, so I uncomment related lines in /etc/squid/squid.conf
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/proxy.auth auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours auth_param basic casesensitive off
Then I create file with password info:
# htpasswd -c /etc/squid/proxy.auth squid
Next step is to hide proxy info. After this step web sites lost ability to detect if you use proxy or not.
For this I added following lines in squid.conf
# Disable client ip forwarding forwarded_for off # Header control header_access Allow allow all header_access Authorization allow all header_access Cache-Control allow all header_access Content-Encoding allow all header_access Content-Length allow all header_access Content-Type allow all header_access Date allow all header_access Expires allow all header_access Host allow all header_access If-Modified-Since allow all header_access Last-Modified allow all header_access Location allow all header_access Pragma allow all header_access Accept allow all header_access Accept-Encoding allow all header_access Accept-Language allow all header_access Accept-Charset allow all header_access Content-Language allow all header_access Mime-Version allow all header_access Cookie allow all header_access Set_Cookie allow all header_access Retry-After allow all header_access Title allow all header_access Connection allow all header_access Proxy-Connection allow all header_access Proxy-Authorization allow all header_access Proxy-Authenticate allow all header_access WWW-Authenticate allow all header_access User-Agent allow all header_access All deny all
If you want to hide or spoof User-Agent, than replace last but one line to
header_replace User-Agent Nutscrape/1.0 (CP/M; 8-bit)
The last step is to add ability to use multiple ip source address depending on proxy address currently used. For example if you use 192.168.17.43:3128 as proxy address then sites detect your ip address as 192.168.17.43.
For this I use file with ip list: one ip per line. Than I run script to generate config:
# i=0; for ip in `cat /tmp/squid-ips.txt`; do i+=1; echo "acl ip${i} myip ${ip}"; echo "tcp_outgoing_address ${ip} ip${i}"; done | tee -a /etc/squid/squid.conf
The last step is to reload squid conf and enable squid startup during system boot
# service squid reload # chkconfig squid on
To check proxy info you can visit this link.
25 апреля 2012
Midnight Commander packages now available for Ubuntu Precise Pangolin
Today I added additional buildbot branch to support upcoming Ubuntu LTS release - Precise Pangolin (12.04).
You can already grab latest midnight commander release for Ubuntu Precise Pangolin from my repository (currently only version 4.8.3 available). Nightly builds will be available within the next few hours.
Enjoy the power of the best console file manager.
You can already grab latest midnight commander release for Ubuntu Precise Pangolin from my repository (currently only version 4.8.3 available). Nightly builds will be available within the next few hours.
Enjoy the power of the best console file manager.
23 апреля 2012
Midnight Commander 4.8.3 release
Yesterday midnight commander team released a brand new 4.8.3 version. More info about release you can get at changelog page. This release doesn't bring any new features, but contains a bunch of bugfixes.
As always you can grab Debian/Ubuntu packages from my repository.
As always you can grab Debian/Ubuntu packages from my repository.
11 апреля 2012
Debian/Ubuntu packages for deadbeef audio player
Recently was released a new version of my favourite DEADBEEF audio player. DeaDBeeF (as in 0xDEADBEEF) is an audio player for GNU/Linux, BSD, OpenSolaris and probably other UNIX-like systems. This player very minimalistic but have all functionality needed to me.
As for now upstream didn't release binary packages for version 0.5.2 for Debian Squeeze, so I decided to build myself packages for Debian (Squeeze, Wheezy, Sid) and Ubuntu (Maverick, Lucid, Natty, Oneiric) both i386 and amd64 versions. You can grab this packages in my repository in section "main" or just simply download from pool directory (ex. for Squeeze)
Much more about deadbeef you can learn on it's SourceForge page.
As for now upstream didn't release binary packages for version 0.5.2 for Debian Squeeze, so I decided to build myself packages for Debian (Squeeze, Wheezy, Sid) and Ubuntu (Maverick, Lucid, Natty, Oneiric) both i386 and amd64 versions. You can grab this packages in my repository in section "main" or just simply download from pool directory (ex. for Squeeze)
![]() |
| Deadbeef 0.5.2 |
Much more about deadbeef you can learn on it's SourceForge page.
10 апреля 2012
Критическая уязвимость в SAMBA 3.0.x - 3.6.3 (включительно)
Наткнулся в новостях на анонс CVE-2012-1182 - наверное самой критической уязвимости в SAMBA, найденной за всю историю существования проекта. Эта уязвимость связана с неверной обработкой запросов RPC и позволяет любому не авторизованному злоумышленнику удаленно выполнить код с привилегиями "root".
В качестве частичного решения проблемы предлагается настроить опцию "hosts allow", но это не поможет в случае подмены ip адреса. Для всех версий SAMBA уже выпущены патчи, но многие дистрибутивы еще не подготовили обновления.
На данный момент обновления готовы только у RHEL (судя по закрытому репорту в багзилле). Надеюсь, что обновления от CentOS и Debian не заставят себя ждать.
Stay tuned так сказать!
UPDATE : Выпущены обновления для RHEL/CentOS (в этот раз centos радует своей оперативностью)
В качестве частичного решения проблемы предлагается настроить опцию "hosts allow", но это не поможет в случае подмены ip адреса. Для всех версий SAMBA уже выпущены патчи, но многие дистрибутивы еще не подготовили обновления.
На данный момент обновления готовы только у RHEL (судя по закрытому репорту в багзилле). Надеюсь, что обновления от CentOS и Debian не заставят себя ждать.
Stay tuned так сказать!
UPDATE : Выпущены обновления для RHEL/CentOS (в этот раз centos радует своей оперативностью)
08 апреля 2012
Решение проблем с настройками клавиатуры при использовании suspend2disk
В прошлом посте я упомянул о проблемах со сбрасывающимися настройками клавиатуры после выхода компьютера из спящего режима. Это происходит из-за того, что в процессе подготовки к спящему режиму выгружаются модули USB. После загрузки устройства вновь подключаются при загрузке USB модулей, а вот настройки к ним уже не применяются.
Временным решением стал ярлык на рабочих столах, но это неудобно. Одним из последующих решений стало выполнение setxkbmap при выходе компа из спящего режима. Чтобы отловить события в системе до и после засыпания на диск, я запустил dbus-monitor и выполнил цикл засыпания/пробуждения.
В процессе изучения полученного лога нашлись записи от UPower (подсистема управления питанием).
Чтобы восстановить настройки клавиатуры, достаточно отловить событие 'Resuming' от UPower и выполнить команду setxkbmap $(cat ~/.Xkbmap). Готовый скрипт можно взять тут.
Позже всплыл баг, когда при одновременной работе двух пользователей настройки восстанавливаются только у пользователя, у которого активна сессия на момент пробуждения. В виде хака добавил прослушивание событий и от ConsoleKit.
Есть еще много мест которые можно улучшить, но это уже буду делать по-мере появления свободного времени. А возможно просто забъю на per-user настройки клавиатуры и просто сделаю на уровне системных настроек. По-идее с ними проблем быть не должно.
Временным решением стал ярлык на рабочих столах, но это неудобно. Одним из последующих решений стало выполнение setxkbmap при выходе компа из спящего режима. Чтобы отловить события в системе до и после засыпания на диск, я запустил dbus-monitor и выполнил цикл засыпания/пробуждения.
$ dbus-monitor --system | tee ~/tmp/dbus-system.log
В процессе изучения полученного лога нашлись записи от UPower (подсистема управления питанием).
$ grep UPower ~/tmp/dbus-monitor.log signal sender=:1.15 -> dest=(null destination) serial=80 path=/org/freedesktop/UPower; interface=org.freedesktop.UPower; member=Sleeping signal sender=:1.15 -> dest=(null destination) serial=81 path=/org/freedesktop/UPower; interface=org.freedesktop.UPower; member=Resuming
Чтобы восстановить настройки клавиатуры, достаточно отловить событие 'Resuming' от UPower и выполнить команду setxkbmap $(cat ~/.Xkbmap). Готовый скрипт можно взять тут.
Позже всплыл баг, когда при одновременной работе двух пользователей настройки восстанавливаются только у пользователя, у которого активна сессия на момент пробуждения. В виде хака добавил прослушивание событий и от ConsoleKit.
Есть еще много мест которые можно улучшить, но это уже буду делать по-мере появления свободного времени. А возможно просто забъю на per-user настройки клавиатуры и просто сделаю на уровне системных настроек. По-идее с ними проблем быть не должно.
Подписаться на:
Сообщения (Atom)
