Pages

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Friday, November 10, 2017

Getting stats from dd -command

While trying to move the contents of one partition to another I used the dd -command like this:
(DO NOT cut'n'paste this command)

dd if=/dev/sda7 of=/dev/sda1

Here's how to get the progress of a long dd-copy:
  1. Open up a terminal (T1) and run your dd-command.
  2. Open another terminal (T2) by pressing Ctrl+Shift +T
  3. In terminal T2 type in: ps aux | grep dd
  4. Find the Pid for the dd-command
  5. In terminal T2 type: kill -USR1 <pid>
  6. Go back to T1 to see the stats printed.

Repeat points 5 and 6 to keep getting an update.

Thursday, September 3, 2015

Wordpress Permalinks not working?

When creating a local website on your own webserver running Apache2 and using Wordpress, you will see that the URL is created by referring to different kind of ID's. This could be Post ID's, Category ID's, Page ID's and so on. So I went into the Wordpress Administration Panel and told it to use permalinks instead. Hoping this would make the URL's a little prettier...

Friday, March 7, 2014

Cleaning out linux-image-x.x.xx-xx-* files

I was suddenly denied access to my in-house web-server with a message telling me the disk is full. After a quick check with df -h I could confirm the root partition used 100%.
First I started to look for "user -files" I could remove, but found out there wasn't all that many of them. Most of the usage was in the folders /lib, /usr and /var. A quick question to my friend google took me in the direction that there could be some linux-image files no longer used that were spending my disk.
Some more searching gave me the following solution to removing these unused kernel files:

Wednesday, January 29, 2014

Personal emails - Mail Merge add-on

 About a year ago I added some info about this little add-on for thunderbird calle Merge Email. I then described how-to use the address-book to make merged emails. Since I am a bit of a fan of this add-on I'll describe using it with a csv-file.

Wednesday, July 31, 2013

LibreOffice 4.1 password protected document

Another release of LibreOfice have been announced and I was quick to download
and install version 4.1. I must admit I have been a big fan of LibreOffice from their first release, but there are still a few bugs that I find annoying. Unfortunately I found a new bug in v.4.1, or at least I thought so...

Wednesday, June 19, 2013

Using netcat as a server

Just this morning I was checking out some piece of software and was trying to setup its mail configuration. But it would not function the way I thought it was supposed to so I had a look into my mail server logfile. With the tailf -command I would be seeing the messages to and from the mail server. But as I was looking at little to no action the logfile suddenly was filling my screen with messages.

Someone was trying to use my mailserver....

Tuesday, December 11, 2012

find files between two dates

Here's a quick tip for how you can find a file between two dates.
Suppose you are looking for a file you know you worked with last friday. At the time of writing this would be on december 7th. Using the find command you can go to your terminal and add the following code:


find . -type f -newerat "2012-12-07" -not -newerat "2012-12-08"


This would search for files acessed between dec. 7th and dec. 8th.
This code snippet also shows an example of how to use the -newerXY parameter of the find -command.

Tuesday, November 27, 2012

Vmware Server 2 - "Failed to initialize monitor device."

After rebooting the server my virtual machines would not start up again. Neither automatically nor manually. This problem had me confused for a while but I finally found a simple solution.

The problem was that kvm-intel module was loaded, so simply removing this, and restarting the vmware service was sufficient to restart my virtual machines.

sudo rmmod kvm-intel
sudo service vmware restart

After this my virtual machines had no problem starting.

Sunday, September 30, 2012

Scaling a pdf file from A3 to A4

This is just a quick tip for converting a pdf file from one pagesize to another.
By using the command convert this is easily achieved.

This is the quickest way I've found to do this:


convert -page a3 infile.pdf -page a4 outfile.pdf

The outfile.pdf should now be sized as an A4 page.
The command is as follows: convert [input file options] infile.pdf [output file options] outfile.pdf

Of course it is possible to convert to and from other sizes as well.

Thursday, August 16, 2012

Password prompt via ssh

Sometimes when working with ssh you want to run a command that require root privileges on the remote host.
For instance when running apt-get install.

The trick is then to add the -t option to ssh so you get to write the remote host password.
Like this:
ssh -t example.com "sudo apt-get install nmap"


Without the -t option you would get the following error:
sudo: no tty present and no askpass program specified



Thursday, August 9, 2012

Encrypted storage


In case you have documents and files you don't want anyone to be able to see there is always the possibility to use truecrypt. Truecrypt will let you use a file or partition as an encrypted storage. It is easy to use and not at all hard to understand. It also supports Linux, Windows and Mac so you can use it on whatever platform you wish.

Truecrypt is no longer safe.
Check their website before using it.

You can even encrypt part of an USB-pendrive and include the files for running the truecrypt program on the USB-drive. This way you will be able to use you USB-device on other computers without needing to install the package on the computer you are working on. (But you will need admin privileges.)

To download TrueCrypt head over to their web-site. Go to the download page and download the package for your platform. After downloading the Linux gzipped tarball you simply extract it and run the truecrypt installation-file.

Step 1:
Run truecrypt to open the GUI for the program and create a new encrypted volume. Using a file is as it can be. Click on Create Volume, select the folder to put the file in, and give it a filename. Follow the instructions to set the encryption, password and any other option.

Step 2:
In the TrueCrypt main window select the slot you want to put your encrypted volume in, click on Select File and navigate to the file you created in the previous step. Click on Mount and type your password for the encrypted filesystem when prompted.

Step 3:
Add files or folders to your encrypted filesystem as you do to any filesystem.

That's all there is to it.
Easy and well functioning way of keeping some documents private.
To use a portable USB-drive check the documentation on TrueCrypt web-site.

Saturday, July 21, 2012

Linux Tutorials

Linux has become the preferred OS for me and my company. Not only for the fact that it is free, but also because of the possibilities it gives us.

For a small company as ours Linux is the perfect solution. It provides us with a stable and secure platform for our servers running mail, webserver, fileserver, printserver, automated backups and a lot more.

Of course we need to know a thing or two about installing it and setting up the various components . And I am always looking for more information on how to configure and setup different parts of Linux and other Open Source Software.

Recently I found out that linux.org had redesigned their site and of course I had to take a look at it.

Sunday, June 10, 2012

Linux Project Blog

This blog is about using linux to do different things. We will be using both server and desktop versions. Since Linux have so many different flavours I find it easier to stick to one distro for both my server an desktop. Currently this is Ubuntu LTS editions. I prefer LTS editions because I find updating every 6 months to be too often and the differences are small between the versions.