Say that your Windows 7 machine had a problem and you can no longer boot in; usually this can be easily fixed by running the bootrec utility to repair the MBR/boot sector
For some very important reasons, this extremely useful tool can only be run from a Windows install DVD and you don't have direct access to it, even from the safe mode. Luckily, you can create a bootable USB key where to place the Windows RE without having to get said DVD - only catch: you'll need access to a working Windows 7 PC.
Now that your friend generously gave you permission to use his PC, let's get started.
Pages
▼
26/10/2014
18/10/2014
[SQL] Escape special characters in LIKE statement
When using the LIKE statement in a SQL query, there are special characters which have a particular meaning such as _ (single character) and % (sequence of characters) which have to be escaped if you intend to actually search for them in the string.
You can do so as:
LIKE 'pattern' ESCAPE 'escape_character'
for example:
SELECT name
FROM mytable
WHERE name LIKE '%John\_D%' ESCAPE '\';
Which will search for any string containing "John_D"
You can do so as:
LIKE 'pattern' ESCAPE 'escape_character'
for example:
SELECT name
FROM mytable
WHERE name LIKE '%John\_D%' ESCAPE '\';
Which will search for any string containing "John_D"
[Ubuntu] Calibri and Microsoft fonts not displayed correctly
When using or displaying fonts from the Microsoft family on Ubuntu, they sometimes appear to be displayed incorrectly, rendering them unreadable. The issue is that the font rendering engine Freetype, uses the embedded bitmaps found inside those fonts which are only there so that they look pretty on Windows.
The solution is to disable that behaviour by creating a file .config/fontconfig/fonts.conf with this content
By logging out and in again, you should finally see them correctly displayed
The solution is to disable that behaviour by creating a file .config/fontconfig/fonts.conf with this content
<match target="font" >
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
By logging out and in again, you should finally see them correctly displayed
[HTML] Image as input button
When creating an HTML form, replacing an input button with an image is as easy as:
<input type="image" src="http://example.com/path/to/image.png" />
[SSL] Create Java keystore from certificate and key
To create a Java keystore file from a certificate and key pair files, you can use the openssl and keytool commands.
First, convert the certificate to PKCS12 format:
openssl pkcs12 -export -in mycertificate.crt -inkey mykey.key -out mycertificate.p12
then create the keystore:
keytool -importkeystore -srckeystore mycertificate.p12 -srcstoretype PKCS12 -destkeystore mycertificate.jks -deststoretype JKS
First, convert the certificate to PKCS12 format:
openssl pkcs12 -export -in mycertificate.crt -inkey mykey.key -out mycertificate.p12
then create the keystore:
keytool -importkeystore -srckeystore mycertificate.p12 -srcstoretype PKCS12 -destkeystore mycertificate.jks -deststoretype JKS
[Ubuntu] Change terminal background color
On Ubuntu Linux, the default gnome terminal theme doesn't lend itself easily to screenshots, since they decided for some reason that violet would be a good background choice.
To change it, install gconf-editor:
sudo apt-get install gconf-editor
Then run it:
gconf-editor &
And browse to:
/apps/gnome-terminal/profiles/Default/
where you should uncheck "use_theme_colors" and change the default background color to anything you like. You will also find all other settings such as foreground color, font and so on.
To change it, install gconf-editor:
sudo apt-get install gconf-editor
Then run it:
gconf-editor &
And browse to:
/apps/gnome-terminal/profiles/Default/
where you should uncheck "use_theme_colors" and change the default background color to anything you like. You will also find all other settings such as foreground color, font and so on.