Записки программиста, обо всем и ни о чем. Но, наверное, больше профессионального.
2013-10-31
Pass out vs. Pass away
Posted by
Valentin
at
12:30
0
comments
Labels: language
2013-10-30
Pro secrets. Start to finish 7/9
Posted by
Valentin
at
12:30
0
comments
Labels: windsurfing
2013-10-29
Ковбой на глиссе
Прыг-скок, вжик — получился ковбой:
http://youtu.be/sCRT8XRCdRM
original post http://vasnake.blogspot.com/2013/10/2013-10-29.html
Posted by
Valentin
at
12:30
0
comments
Labels: windsurfing
2013-10-28
Zero based indexing
Posted by
Valentin
at
12:30
0
comments
Labels: programming
2013-10-25
Dropbox
~/Dropbox/.dropbox.cache/
%USERPROFILE%\My Documents\My Dropbox\.dropbox.cache\
Posted by
Valentin
at
12:30
0
comments
Labels: грабли
2013-10-24
Plotting Time Series
Posted by
Valentin
at
12:30
0
comments
2013-10-23
Python Number Conversion Chart
From
|
To
|
Expression
|
---|---|---|
45
|
"45"
|
str(data)
|
45
|
"101101"
|
bin(data)
|
45
|
"2D"
|
hex(data)
|
45
|
"\x00\x00\x00\x2d"
|
struct.pack('!i', data)
|
"45"
|
45
|
int(data)
|
"45"
|
"3435"
|
data.encode('hex')
|
"101101"
|
45
|
int(data, 2)
|
"2D"
|
45
|
int(data, 16)
|
"2D"
|
"\x2d"
|
binascii.unhexlify(data) or data.decode('hex')
|
"\x00\x00\x00\x2d"
|
45
|
struct.unpack('!i', data)[0]
|
"\x2d"
|
"2D"
|
binascii.hexlify(data)
|
"3435"
|
"45"
|
data.decode('hex')
|
Posted by
Valentin
at
12:30
0
comments
Labels: cheatsheet, python
2013-10-22
toolz
Posted by
Valentin
at
12:30
0
comments
Labels: python
2013-10-21
Дневник виндсерфера
Posted by
Valentin
at
12:30
4
comments
Labels: holyday, windsurfing
2013-10-18
Rotate jpg photo
find -iname '*.jpg' -type f -exec sh -c '[ "0$(jpegexiforient -n "{}")" -le "1" ] || exiftran -aibp "{}"' \;
Posted by
Valentin
at
18:13
0
comments
2013-10-17
Имеются файлы, ожидающие записи на диск
Posted by
Valentin
at
12:30
0
comments
Labels: Microsoft
2013-10-16
Back in the USSR
Posted by
Valentin
at
18:04
2
comments
Labels: holyday, windsurfing
Pro secrets. Start to finish 6/9
Posted by
Valentin
at
12:30
0
comments
Labels: video, windsurfing
2013-10-15
pip & virtualenv
Posted by
Valentin
at
12:30
0
comments
Labels: python
2013-10-14
Pro secrets. Start to finish 5/9
Posted by
Valentin
at
12:30
0
comments
Labels: video, windsurfing
2013-10-11
Add to map ArcGIS tiled mapservice with different spatialreference
//~ dynamiclayer // http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer //~ featurelayer // http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/MapServer/0 //~ tiledMap // http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer addAGSLayer: function(layerURL) { var req = esri.request({ url: layerURL, content:{"f": "json"}, callbackParamName:"callback" }); req.then( dojo.hitch(this, function(lyrmeta) { var tiledMap = lyrmeta.singleFusedMapCache || false; var haveLayers = lyrmeta.layers || false; if(haveLayers) haveLayers = true; var lyr = null; if(tiledMap) { if(lyrmeta.spatialReference.wkid == map.spatialReference.wkid) { lyr = new esri.layers.ArcGISTiledMapServiceLayer(layerURL, {id: layerURL} ); } else { lyr = new esri.layers.ArcGISDynamicMapServiceLayer(layerURL, {id: layerURL}); } } else { if(haveLayers) { lyr = new esri.layers.ArcGISDynamicMapServiceLayer(layerURL, {id: layerURL}); } else { lyr = new esri.layers.FeatureLayer(layerURL, { id: layerURL, mode: esri.layers.FeatureLayer.MODE_ONDEMAND, outFields:["*"] } ); } } if(lyr) { map.addLayer(lyr); } }), dojo.hitch(this, function(err) { alert("addAGSLayer failed, url: " + layerURL); }) ); // req.then } |
Posted by
Valentin
at
12:30
0
comments
2013-10-10
Python Wrapper for NVD3
from nvd3 import pieChart #Open File to write the D3 Graph output_file = open('test-nvd3.html', 'w') type = 'pieChart' chart = pieChart(name=type, color_category='category20c', height=450, width=450) chart.set_containerheader("\n\n<h2>" + type + "</h2>\n\n") #Create the keys xdata = ["Orange", "Banana", "Pear", "Kiwi", "Apple", "Strawberry", "Pineapple"] ydata = [3, 4, 0, 1, 5, 7, 3] #Add the serie extra_serie = {"tooltip": {"y_start": "", "y_end": " cal"}} chart.add_serie(y=ydata, x=xdata, extra=extra_serie) chart.buildhtml() output_file.write(chart.htmlcontent) #close Html file output_file.close()
Posted by
Valentin
at
12:30
0
comments
Labels: JS, python, web-develop
2013-10-09
Pro secrets. Start to finish 4/9
Posted by
Valentin
at
12:30
0
comments
Labels: video, windsurfing
2013-10-08
vsftpd on CentOS
yum install vsftpd nano /etc/vsftpd/vsftpd.conf anonymous_enable=NO nopriv_user=ftpsecure local_enable=YES chroot_local_user=NO listen=YES #local_root=/var/www/ftp EOF chkconfig vsftpd on adduser ftpsecure passwd ftpsecure usermod -s /sbin/nologin ftpsecure system-config-firewall-tui nano /etc/sysconfig/iptables nano /etc/sysconfig/iptables-config iptables -L -vn service iptables stop # а вдруг оно не работает из-за файрволла? service vsftpd restart
getsebool -a | grep ftp setsebool -P ftp_home_dir on
service iptables start iptables: Applying firewall rules: [ OK ] iptables: Loading additional modules: nf_conntrack_ftp [ OK ] iptables -L -vn Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 489 174K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 8 438 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:21 61 9185 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited nano /etc/sysconfig/iptables-config IPTABLES_MODULES="nf_conntrack_ftp" EOF
nano /etc/vsftpd/vsftpd.conf chroot_local_user=NO local_root=/var/www/ftp EOF mkdir -p /var/www/ftp chown -R ftpsecure:ftpsecure /var/www chmod -R 777 /var/www setsebool -P allow_ftpd_full_access on service vsftpd restart
audit2allow -a
yum provides \*/audit2allow policycoreutils-python-2.0.83-19.30.el6.i686 : SELinux policy core python utilities Repo : base Matched from: Filename : /usr/bin/audit2allow
Posted by
Valentin
at
12:30
1 comments
Архив блога
-
▼
2013
(240)
-
▼
октября
(24)
- Pass out vs. Pass away
- Pro secrets. Start to finish 7/9
- Ковбой на глиссе
- Zero based indexing
- Dropbox
- Plotting Time Series
- Python Number Conversion Chart
- toolz
- Дневник виндсерфера
- Rotate jpg photo
- Имеются файлы, ожидающие записи на диск
- Back in the USSR
- Pro secrets. Start to finish 6/9
- pip & virtualenv
- Pro secrets. Start to finish 5/9
- Add to map ArcGIS tiled mapservice with different ...
- Python Wrapper for NVD3
- Pro secrets. Start to finish 4/9
- vsftpd on CentOS
- Pro secrets. Start to finish 3/9
- Новые слова
- Pro secrets. Start to finish 2/9
- Pro secrets. Start to finish 1/9
- VPS/VDS хостинг
-
▼
октября
(24)