Blog
Resizing loop back fileystems
I recently needed to resize an existing loop back fileystem which
was created with dd after some research i came up with the following which worked fine for me.
First you need to get the current image size preferably in megabytes this can be done with
# du -m loop-back-image.img
300 loop-back-image.imgIt says the size is 300mb, so here is how we can add another 100mb to it.
# dd if=/dev/zero of=loop-back-image.img bs=1M seek=300 count=100seek=300 means that dd will start at this point which is the end, and count=100 tells dd to add 100mb to that point, so we end up with a total size of 400mb. Run resize2fs on the enlarged 400mb image, it will resize the ext2 filesystem on it to fill the image.
# resize2fs loop-back-image.imgIf you want to reduce the loop back image size you first have to resize the filesystem on it.
# resize2fs loop-back-image.img 200MAfterwards you can run 'dd' on the 300mb image to reduce it to 200mb.
# dd if=/dev/zero of=loop-back-image.img bs=1M seek=200 count=0Again seek=200 says dd to start at 200mb and count=0 means that it should add nothing to that point so we end up with a total image size of 200mb.
Debian update and NO_PUBKEY found
To add the requested key do the following go to http://ftp-master.debian.org/ and download the archive signing key. Then add it to the system as shown below and go on normally.
apt-key add [file-of-key]Marc
Running Lotus Notes 6.5.x with WINE
I recently needed Lotus Notes 6.5.2 for business purposes, i knew that it kind of worded with WINE and so i gave it a try. Here are my tips for others who have to run Notes under a unix-like operating system.
1) Take a wine version which is known to work (20050725) newer
ones like 0.9 don't (at least i couldn't manage to make it work).
2) Install the notes client on a windows box
3) Adjust all settings on the windows box
- set the webrowser to notes
- set the sametime connection to manual
- configure proper TCP/IP settings and disable everything
else (NETBIOS)
4) Copy the notes directory over to the linux machine
5) Copy mfc42.dll and msvcp60.dll from C:\Windows\System32 to
~/.wine/drive_c/windows/system
6) Launch winecfg and set the windows version to Win98
7) Run Notes with wine "c:\program files\lotus\notes\nlnotes.exe"
Additional hints and help may be found in the comments in wine's appdb, the lotus notes ibm forum or over here.
Marc
Stopping SSHD bruteforcing with fail2ban
Ok today i had enough from those script kiddys trying to break into one of my boxes by bruteforcing my sshd. So i googled a bit and found fail2ban from the homepage:
Fail2Ban scans log files and bans IP that makes too many password
failures. It updates firewall rules to reject the IP address.
Of course still better would be to disallow all authentication methods but
key-files. Another approach to solve this problem may be portknocking.
Marc
Installing Standard Java(tm) on Debian in a nice way
First of all whenever possible i would recommend using a free alternative like (classpath, kaffe or gcj) but sometimes this is simply not possible because some features are not yet implemented. Since there are no official Sun Java package in Debian, we have to install it from another source or manually. As always there are different ways to accomplish this, we could for example simply fetch the *.bin file from the sun page, make it executable and let it extract it's content to /usr/local and then creating some symlinks. Or try to convert the rpm-file into a deb with alien and then installing it with dpkg. Another opertiunity would be to use prepacked java packges from blackdown.org however they do currently not support Java 1.5.
Fortunately there is another solution, namely java-package which will make our life a bit easier. Here is a short description of the package.
apt-cache show java-package
Description: utility for building Java(TM) 2 related Debian packages
This package provides the capability to create a debian package from
a Java(TM) 2 distribution by just running make-jpkg <filename>.
.
This program currently works with the following Java(TM) 2 Runtime
Environments and Development Kits:
.
* Sun Microsystems(TM) 1.4 and 1.5 Standard Edition
* IBM(TM) 1.3, 1.4, and 5.0 Standard Edition
* Blackdown Java-Linux 1.3 and 1.4 Standard Edition
Tag: langdevel::javaAs you can read installing java is as simply as executing one command.
make-jpkg <filename-of-java-package>
This simplified my process of installing standard java hope it will help you too.
Marc
