November 2011
1 post
June 2011
1 post
eiffel360x asked: What PHP IDE would you advise me? I want to dive into the PHP world and extend my knowledge in this language but I don't have so much time to practice 'cause I work full time.
March 2011
12 posts
6 tags
Mounting FreeBSD partitions inside a LVM volume in...
No need for kpartx in this case. Just check the FreeBSD disklabels inside the logical volume. This can be done using fdisk:
#fdisk /dev/vg0/backup
Command (m for help): b
Reading disklabel of /dev/vg0/backup1 at sector 64.
BSD disklabel command (m for help): u Changing display/entry units to sectors
BSD disklabel command (m for help): p
8 partitions:
# start end size ...
tumblrbot asked: WHERE WOULD YOU MOST LIKE TO VISIT ON YOUR PLANET?
3 tags
Changing a failed Disk in Software RAID-1
You know something’s wrong when you see this:
# cat /proc/mdstat Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid10] md2 : active raid1 sdb3[2] sda3[0] 1458830400 blocks [2/1] [U_] md0 : active raid1 sdb1[1] sda1[0] 4200896 blocks [2/2] [U_] md1 : active raid1 sdb2[2] sda2[0] 2104448 blocks [2/1] [U_] ...
5 tags
Quick Hibernate Java Persistence API Setup on Java...
To quickly setup a working Java SE project using Hibernate, download Hibernate Core 3.5.0-CR-1, which also includes EntityManager and Annotations.
Add all jarfiles in the lib/required directory to your project, with the exception of the SLF4J API, which is included in the SLF4J distribution. Download SLF4J, add the slf4j-api jarfile and any slf4j logprovider to the project. If using slf4j-log4j,...
5 tags
Blocking blind SQL injections using mod_rewrite
If there are a lot of SQL statements in the Apache logs, there’s most probably someone running blind SQL injection attacks against one of the local websites. Above all one has to make shure, scripts are not vulnerable to such attacks, but often attackers exploit bugs that can’t be easily fixed.
To block most of this kind of hacking attempts, one can use the following mod_rewrite...
3 tags
Tunneling Samba over SSH on Mac OS X
When using localhost for tunneling Samba on Mac OS X, the following error message will be displayed on trying to connect to smb://localhost:
The server “127.0.0.1” is available on your computer. Access the volumes and files locally.
A simple workaround is to add an alias to lo0:
sudo ifconfig lo0 alias 127.0.0.2 up
Then simply create the tunnel:
sudo ssh -L 127.0.0.2:139:DESTINATIONIP:139...
2 tags
INSERT OR UPDATE for PostgreSQL
The easiest way I found to simulate a INSERT OR UPDATE using PostgreSQL (or pretty much any other RDB) is using the INSERT INTO … SELECT syntax:
INSERT INTO myTable (myKey) SELECT myKeyValue WHERE myKeyValue NOT IN (SELECT myKey FROM myTable); UPDATE myTable SET myUpdateCol = myUpdateColValue WHERE myKey = myKeyValue;
This way you don’t need any complex trigger or transaction...
6 tags
Short Xen w/ Ubuntu Routed Hostonly Network HowTo
- install latest Ubuntu server - install Xen 3.3 - get Xen kernel from Ubuntu Hardy Heron repos - add hostonly network:
brctl addbr hostonly
- set dom0 IP for hostonly network:
ifconfig hostonly 10.0.0.1 netmask 255.255.255.0
- start Xen daemon:
/etc/init.d/xend start
- start domU:
xm create xxxx.xen [-c]
- access console on paravirtualized domU:
xm console domU-name
- close Xen console:...
2 tags
Installing the GPLPV drivers on a Windows 2008 R2...
To speed up a Windows domU, the GPLPV drivers do a great job in paravirtualising essential parts of the system. The latest Windows versions require drivers to be signed in order to be installed. When trying to run gplpv_Vista2008x64_0.11.0.188.msi on a Windows 2008 R2 domU, the installer shows a message about activating “test signing” mode.
This is done via:
bcdedit.exe /set...
1 tag
Ubuntu 10.4 (Lucid Lynx) and...
Apparently due to some usability tests, the newly available Ubuntu Lucid Lynx Beta has the window buttons on the left side. This is fine for many and if you are used to keyboard shortcuts you wouldn’t care about placement of buttons anyway, but in case you want to have the old style back, this is for you.
Open a Terminal and run the following:
gconf-editor
This opens a registry-like...