original post http://vasnake.blogspot.com/2013/05/tornado-socketio.html
Tools
Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2013-05-31
Tornado + Socket.IO
original post http://vasnake.blogspot.com/2013/05/tornado-socketio.html
Posted by Valentin at 17:49 0 comments
2013-05-30
Python datetime to JSON
EPOCH = datetime.datetime.utcfromtimestamp(0) def unix_time_millisec(dt): delta = dt - EPOCH return delta.total_seconds() * 1000.0 def jsonify(obj): if isinstance(obj, decimal.Decimal): return float(obj) elif isinstance(obj, datetime.datetime): return long(unix_time_millisec(obj)) raise TypeError(repr(obj) + " is not JSON serializable") text = simplejson.dumps(data, ensure_ascii=False, sort_keys=True, indent=2, default=jsonify, use_decimal=False) |
Posted by Valentin at 18:27 0 comments
2013-05-29
Git credential.helper cache and MS Windows
git config --global credential.helper cache git config --global credential.helper 'cache —timeout=3600'
git config --global credential.helper winstore
Posted by Valentin at 20:19 0 comments
Labels: programming, VCS
2013-05-28
Operational transformation
Posted by Valentin at 17:48 0 comments
Labels: citation, web-develop
2013-05-27
ФФ новости
Posted by Valentin at 23:44 0 comments
2013-05-24
Где иллюзии а где реальность
original post http://vasnake.blogspot.com/2013/05/blog-post_24.html
Posted by Valentin at 18:20 2 comments
Labels: 3D
2013-05-23
GeoJSON + MongoDB
original post http://vasnake.blogspot.com/2013/05/geojson-mongodb.html
Posted by Valentin at 17:09 0 comments
2013-05-22
Mapfeatureserver PoC
Posted by Valentin at 17:17 0 comments
2013-05-21
GeoJSON 2 EsriJSON
if geometryType == u'esriGeometryPoint': geometry = {"x": shape['coordinates'][0], "y": shape['coordinates'][1]} elif geometryType == u'esriGeometryPolyline': geometry = {"paths": shape['coordinates']} elif geometryType == u'esriGeometryPolygon': if len(shape['coordinates']) == 1: geometry = {"rings": shape['coordinates'][0]} else: geometry = {"rings": shape['coordinates']} rings = [] for ring in shape['coordinates']: for e in ring: rings.append(e) geometry = {"rings": rings} else: raise ValueError("geoJson2agJson: unknown geometry type '%s'" % geometryType) |
{u'type': u'MultiPolygon', u'coordinates': [ [[ [4279602.386113361, 7520773.048816763], [4279572.070031156, 7520668.786903687], [4279455.184565822, 7520710.387695587], [4279602.386113361, 7520773.048816763] ]], [[ [4208589.216875655, 7569584.6493480615], [4208579.177972653, 7569396.323268423], [4207803.281121826, 7568963.732610181], [4208589.216875655, 7569584.6493480615] ]], [[ [4226201.053365226, 7697045.899310788], [4226164.317933269, 7697577.007928321], ... [4211359.938852671, 7621739.802166396], [4226201.053365226, 7697045.899310788] ]] ]} |
«rings»: [ [ [4279602.386113361, 7520773.048816763], [4279572.070031156, 7520668.786903687], [4279455.184565822, 7520710.387695587], [4279602.386113361, 7520773.048816763] ], [ [4208589.216875655, 7569584.6493480615], [4208579.177972653, 7569396.323268423], [4207803.281121826, 7568963.732610181], [4208589.216875655, 7569584.6493480615] ], [ [4226201.053365226, 7697045.899310788], [4226164.317933269, 7697577.007928321], ... [4211359.938852671, 7621739.802166396], [4226201.053365226, 7697045.899310788] ]] |
Posted by Valentin at 14:50 0 comments
2013-05-20
NUT upssched
Гугель почему-то не хочет индексировать комментарии к постам на Blogger.com.
Например, уже неделю как есть полезный коммент к посту про ИБП в Линукс
http://vasnake.blogspot.ru/2011/11/blog-post_03.html
а поиском до сих пор не находится. Поэтому выношу полезняшку в отдельный пост:
Дополнение к посту
http://vasnake.blogspot.ru/2011/11/blog-post_03.html
про использование UPS в Linux через пакет NUT
В Debian Wheezy я столкнулся с проблемой - при пропадании питания не выключается хост и syslog содержит сообщение типа
"upssched Failed to connect to parent and failed to create parent: No such file or directory"
Как выяснилось, папка
/var/run/nut/upssched, указанная в конфиге /etc/nut/upssched.conf
все время куда-то пропадает.
Решение проблемы: в конфиге upssched.conf указать папку
/var/run/nut
вместо
/var/run/nut/upssched
Тогда все работает как надо.
Posted by Valentin at 17:09 0 comments
2013-05-19
Мы решили сэкономить и купили ПароходЪ
Posted by Valentin at 02:04 4 comments
Labels: windsurfing
2013-05-16
Debian Wheezy, Realtek NIC and WOL
lspci
06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
tar jfxv ~/vshare/sqz2/realtek/r8168-8.035.00.tar.bz2.tar.bz2
su -l pushd /home/valik/rt/r8168-8.035.00 bash autorun.sh
lsmod | grep r81
echo blacklist r8169 >> /etc/modprobe.d/blacklist-nic.conf
/etc/init.d/networking restart ifconfig -a
ethtool -s eth0 wol g ethtool eth0
Supports Wake-on: pumbg Wake-on: g
wakeonlan 50:e5:49:3b:0c:be
etherwake 50:e5:49:3b:0c:be
Posted by Valentin at 13:57 0 comments
2013-05-15
/usr должен быть в корне
su -l mkdir /usr2 cd /usr find . -depth -print0 | sudo cpio --null --sparse -pvd /usr2
cp /etc/fstab ./fstab.orig nano /etc/fstab
ls -la /usr
rm -rf /usr mv /usr2 /usr reboot
nano /etc/fstab UUID=e18a87d3-d784-40d4-ae76-ec35f99a7059 /usr blkid /dev/sda6: LABEL="usr" UUID="e18a87d3-d784-40d4-ae76-ec35f99a7059" TYPE="ext4"
mount
mkdir /mnt/sda6 cryptsetup --verbose --verify-passphrase create formerusr /dev/sda6 cryptsetup --verbose status formerusr mke2fs -t ext4 /dev/mapper/formerusr mount /dev/mapper/formerusr /mnt/sda6 chown -R valik /mnt/sda6
umount /dev/mapper/formerusr cryptsetup remove formerusr cryptsetup create formerusr /dev/sda6 fsck -V /dev/mapper/formerusr mount /dev/mapper/formerusr /mnt/sda6
Posted by Valentin at 16:49 2 comments
2013-05-14
Plone + Cartobonus = ESLMapDocument
original post http://vasnake.blogspot.com/2013/05/plone-cartobonus-eslmapdocument.html
Posted by Valentin at 17:07 0 comments
Labels: ArcGIS, GIS, opensource, web-develop, Zope(Plone)
Upgrade from Squeeze to Wheezy
tar -zcvf ./etc-backup.tgz /etc tar -zcvf ./var.lib.dpkg-backup.tgz /var/lib/dpkg tar -zcvf ./var.lib.aptitude-backup.tgz /var/lib/aptitude tar -zcvf ./var.lib.apt-backup.tgz /var/lib/apt
aptitude purge virtualbox-4.2 aptitude purge openoffice.org aptitude purge openoffice.org-core
dpkg --audit aptitude search "~ahold" dpkg --get-selections | grep 'hold$' apt-get autoremove apt-get clean
nano /etc/apt/sources.list deb http://mirror.yandex.ru/debian/ wheezy main contrib non-free deb-src http://mirror.yandex.ru/debian/ wheezy main contrib non-free
apt-get update apt-get upgrade apt-get dist-upgrade
script -t 2>~/upgrade-wheezy01.time -a ~/upgrade-wheezy01.script
du -shm /lib rm -rf /lib/modules/2.6.32-5-amd64
nano /etc/modprobe.d/blacklist.conf
deb http://mirror.yandex.ru/debian/ wheezy main contrib non-free deb-src http://mirror.yandex.ru/debian/ wheezy main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free deb http://mirror.yandex.ru/debian/ wheezy-updates main contrib deb-src http://mirror.yandex.ru/debian/ wheezy-updates main contrib deb http://download.virtualbox.org/virtualbox/debian wheezy contrib non-free
original post http://vasnake.blogspot.com/2013/05/upgrade-from-squeeze-to-wheezy.html
Posted by Valentin at 02:21 0 comments
2013-05-07
Смешной перевод
original post http://vasnake.blogspot.com/2013/05/blog-post_7.html
Posted by Valentin at 16:55 0 comments
2013-05-06
Они о нас позаботятся
Posted by Valentin at 19:21 0 comments
Архив блога
-
▼
2013
(240)
-
▼
мая
(17)
- Tornado + Socket.IO
- Python datetime to JSON
- Git credential.helper cache and MS Windows
- Operational transformation
- ФФ новости
- Где иллюзии а где реальность
- GeoJSON + MongoDB
- Mapfeatureserver PoC
- GeoJSON 2 EsriJSON
- NUT upssched
- Мы решили сэкономить и купили ПароходЪ
- Debian Wheezy, Realtek NIC and WOL
- /usr должен быть в корне
- Plone + Cartobonus = ESLMapDocument
- Upgrade from Squeeze to Wheezy
- Смешной перевод
- Они о нас позаботятся
-
▼
мая
(17)