Uno scrittoio digitale …

20 ottobre 2012

Print man pages

Archiviato in: linux — Tag:, , , — admin @ 22:44

> man -t ifconfig | ps2pdf -> ifconfig.pdf

18 ottobre 2012

Pep 3149

Archiviato in: linux, python — Tag:, — admin @ 23:00

pi@raspberrypi ~ $ ls -l /usr/bin | grep python
-rwxr-xr-x 1 root root 30284 Jun 6 03:08 dh_python2
-rwxr-xr-x 1 root root 21455 Aug 2 22:04 dh_python3
-rwxr-xr-x 1 root root 94 Apr 22 20:32 idle-python2.7
-rwxr-xr-x 1 root root 94 Jun 25 23:11 idle-python3.2
lrwxrwxrwx 1 root root 23 Apr 23 09:09 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root 23 Jun 26 05:34 pdb3.2 -> ../lib/python3.2/pdb.py
lrwxrwxrwx 1 root root 31 Aug 2 22:04 py3versions -> ../share/python3/py3versions.py
lrwxrwxrwx 1 root root 9 Jun 6 03:08 python -> python2.7
-rwxr-xr-x 1 root root 2736676 Apr 23 09:08 python2.7
lrwxrwxrwx 1 root root 9 Aug 2 22:04 python3 -> python3.2
lrwxrwxrwx 1 root root 11 Jun 26 05:34 python3.2 -> python3.2mu
-rwxr-xr-x 1 root root 2657952 Jun 26 05:34 python3.2mu
lrwxrwxrwx 1 root root 11 Aug 2 22:04 python3mu -> python3.2mu
lrwxrwxrwx 1 root root 29 Jun 6 03:08 pyversions -> ../share/python/pyversions.py

Mi ha incuriosito la versione mu di python3.2 … e carcando, cercando … la risposta si trova qua.

9 ottobre 2012

Startup Connection WiFi on Raspberry Pi

Archiviato in: linux — Tag:, , — admin @ 22:47

1) create run script

> sudo nano /etc/init.d/start-up.sh …
paste this:

#!/bin/sh -e
echo “Starting WiFi…”
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
sleep .5s
dhclient wlan0
echo “WiFi should be started”
exit 0

2) update-rc.d start-up.sh defaults

3) sudo apt-get install wpasupplicant

4) create configuration file

> sudo nano /etc/wpa_supplicant.conf
paste this:

network={
ssid=”YOURSSID”
psk=”YOURPASSWORD”
}

5) remove wire and restart your raspberry-pi

4 ottobre 2012

Maven: aggiungere un file alla web-app con le svn info (version e path)

Archiviato in: java — Tag: — admin @ 09:47

<properties>
	<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
	<buildDateTime>${maven.build.timestamp}</buildDateTime>
</properties>

<build>
	<plugins>
		<plugin>
			<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
			<artifactId>svn-revision-number-maven-plugin</artifactId>
			<version>1.13</version>
			<executions>
				<execution>
					<goals>
						<goal>revision</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<entries>
					<entry>
						<path>${project.basedir}</path>
						<prefix>a</prefix> <!-- this variable is used to populate version.xml -->
					</entry>
				</entries>
			</configuration>
		</plugin>
		<plugin>
			<artifactId>maven-antrun-plugin</artifactId>
			<executions>
				<execution>
					<phase>generate-sources</phase>
					<configuration>
						<tasks>
							<copy file="src/main/resources/version.template.xml" tofile="src/main/webapp/version.xml" overwrite="true" />
							<replace file="src/main/webapp/version.xml" token="${revision}" value="${a.revision}"/>
							<replace file="src/main/webapp/version.xml" token="${path}" value="${a.repository}/${a.path}"/>
							<replace file="src/main/webapp/version.xml" token="${timestamp}" value="${buildDateTime}"/>
						</tasks>
					</configuration>
					<goals>
						<goal>run</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

3 ottobre 2012

Difference between ConcurrentHashMap and Collections.synchronizedMap

Archiviato in: java — Tag: — admin @ 19:05

read me

Funziona con WordPress