Un tema per un giorno insolio .ghghgh.
Archive for October, 2008
Halloween
Friday, October 31st, 2008Mount –bind
Monday, October 27th, 2008A mio promeria in primis :
mount --bind /org/location /new/location
nell’ /etc/fstab si scrive
/org/location /new/location bind defaults,bind 0 0
Obtain Multiaddress IP with java
Thursday, October 16th, 2008If you have many address, you can obtain all :
[java]
InetAddress[] e = InetAddress.getAllByName(InetAddress.getLocalHost().getCanonicalHostName());
[/java]
Tracd : trac standalone
Wednesday, October 15th, 2008Sto sviluppando un progetto in questo momento e mi è nata la necessità di tenere traccia del processo di sviluppo, in particolare i task da eseguire e quelli già eseguiti, bug eventuali dei beta tester e cosi via. Mi sono già trovato in questa situazione e già mi ero rivolto a Trac un sistema ben rodato, pero lo avevo usato in affianco ad apache, questo giro invece ho la necessità di usarlo senza installare un server web specifico (che sia apache o lighttpad); per fortuna trac ha un suo server (tracd) che rende apparentemente facile la soluzione. Ecco come ho fatto :
- Creato un progetto con trac-admin
trac-admin /var/trac/project1/ initenv
- Creato un repository
svnadmin create /var/svn/project1
- Creazione dell’utente
htdigest -c /var/trac/project1/users.mytest project1 utente
- Assegnazione permessi
trac-admin /var/trac/project1 permission add utente TRAC_ADMIN
- Avvio del demone
tracd -a project1,/var/trac/project1/users.mytest,project1 /var/trac/project1
--hostname localhost -p 8000
Ora passero alla personalizzazione, postero se trovo qualcosa di interessante.
-edit-
ho trovando girando per la rete la procedura corretta per potersi personalizzare il template:
copy site template defaults from /usr/share/trac/templates to /www/trac/projectname/templates and point templates variable in /www/trac/projectname/conf/trac.ini to /www/trac/projectname/templates. Then you can edit the templates and it will use your project ones instead of the defaults.
Marcia indietro, il modo corretto è quello di modificare il file site.html dentro la cartella templates nel progetto, cosi è molto più elegante e pulito!
No row with the given identifier exists
Friday, October 10th, 2008I’ve recently gotten this infamous Exception while doing a HQL query.
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [it.linksystem.csai.model.Operator#3]
This was rather strange as the system worked quite well and it successfully retrieved selects on that entity using the Criteria API.
Looking on the net, most suggestions and FAQ’s point to a different direction. My issue was rather simple mapping error. The entity on which I was doing selects, was referencing an Operator. In my (java) model, Admin inherits from Operator, and both inherit from User. In fact persisting the entities was no problem no matter if the entity persisted was referencing an Admin or Operator. If however there was an instance that referenced an Admin hibernate would launch the Exception if one executed a HQL query (I guess Criteria queries follow a different path to create the select and are immune to this issue).
My mistake was that I didn’t know you can nest a subclass tag in another subclass tag in the hbm file so I’ve put all subclasses directly under User. Once I’ve moved Admin under Operator the HQL works fine.
I hope this will help somebody.
Leopard Time Machine su condivisione di rete
Tuesday, October 7th, 2008Sono giorni che cerco un buon hdd esterno firewire… non ne ho trovato nessuno che mi soddisfi, cosi mi sono domandato : E’ possibile fare il backup con la time machine sopra partizioni condivise di rete (samba, nfs, afs)? Ebbene si. Quindi basta armarsi di un disco da 1 terabyte, una schede di rete gigabit e il gioco è praticamente fatto. La time machine non vede il disco di rete? semplice seguendo questo tutorial. Di fatto basta solamente digitare dal terminale
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
stando attenti a non essere root! Poi dopo un po che si è montata la partizione remota comparirà tra quelle sceglibili per il backup dall’interfaccia della time machine.
EDIT
Errata corrige non funziona, nel senso vede il disco via AFS/SAMBA/NFS ma poi non vi riesce a scrivere sopra ‘-.-