Centroid.EU Blog

(this blog is mostly encrypted - adults only)
  

Previous Page


Fritzbox 7930 NAS too slow!

June 30th, 2012

I bought my parents a Fritzbox 7930 made by AVM. It's a nice box but it can't do everything. I think it's underpowered as I get only 4.5 MB/s writes via ftp to this thing. I get less with CIFS which prompted me to write a utility with ftplib that reads from stdin and dumps to a file via ftp. The cpu on the fritzbox is at 99% and it won't go any faster. Here is my program:

#include <sys/types.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ftplib.h>

#define FTPUSER 	"ftpuser"
#define FTPPASS		"somepasswd"

int
main(int argc, char *argv[])
{
	char *user = FTPUSER;
	char *pass = FTPPASS;
	netbuf *nControl = NULL;
	netbuf *xControl;
	char buf[512];
	int ch;
	int len;
	
	while ((ch = getopt(argc, argv, "u:p:")) != -1) {
		switch (ch) {
		case 'u':
			user = optarg;
			break;
		case 'p':
			pass = optarg;
			break;
		}
	}

	argc -= optind;
	argv += optind;

	if (argv[0] == NULL || argv[1] == NULL) {
		perror("args -> IP file");
		exit(1);
	}

	FtpInit();
	

	if (FtpConnect(argv[0], &nControl) == 0) {
		perror("FtpConnect");
		exit(1);
	}

	
	if (FtpLogin(user, pass, nControl) == 0) {
		perror("FtpLogin");
		exit(1);
	}

	if (FtpChdir("SAMSUNG-HD154UI-01/", nControl) == 0) {
		perror("FtpChdir");
		exit(1);
	}

	if (FtpAccess(argv[1], 
		FTPLIB_FILE_WRITE, FTPLIB_IMAGE, nControl, &xControl) == 0) {
		perror("FtpAccess");
		exit(1);
	}	



	while ((len = read(STDIN_FILENO, &buf, sizeof(buf))) > 0) {
		if (FtpWrite(buf, len, xControl) < 0) {
			perror("FtpWrite");
			exit(1);
		}
	}
	
	if (FtpClose(xControl) == 0) {
		perror("FtpClose");
		exit(1);
	}

	FtpQuit(xControl);
	FtpQuit(nControl);

	exit (0);
}
Anyhow if you don't believe me watch these statistics with dump(8):
  DUMP: Date of this level 0 dump: Sat Jun 30 17:15:09 2012
  DUMP: Dumping /dev/sdb1 (/) to standard output
  DUMP: Label: none
  DUMP: Writing 10 Kilobyte records
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 158901841 blocks.
  DUMP: Volume 1 started with block 1 at: Sat Jun 30 17:15:13 2012
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: 0.81% done at 4273 kB/s, finished in 10:14
  DUMP: 1.64% done at 4340 kB/s, finished in 10:00
  DUMP: 2.50% done at 4416 kB/s, finished in 9:44
  DUMP: 3.37% done at 4461 kB/s, finished in 9:33
  DUMP: 4.23% done at 4485 kB/s, finished in 9:25
  DUMP: 5.10% done at 4498 kB/s, finished in 9:18
  DUMP: 5.95% done at 4499 kB/s, finished in 9:13
I'll be taking the external hardrive back to this computer for backups. Too bad.

0 comments

Going to the moon? You'll need this!

June 30th, 2012

I'm a big proponent of GW Bush's moon to mars idea. I think we should establish a base on the moon first before venturing to mars. However to needlessly spend fuel to land on the moon is pointless, you'll need this, a lunar space elevator.. Thanks to Brad Guth for implanting that idea in my head.

0 comments

Congratulations to China

June 30th, 2012

Since I get chinese people looking at this blog occasionally I want to congratulate you on your spacetrip and first chinese woman in space. I was looking at the " CSS" earlier today. Pretty cool! I hope one day germany will be able to design space stations, or perhaps europe. How about on the moon!?

0 comments

Solstice in 4 days

June 16th, 2012

Hi, the solstice is in four days from now. Get your celebration planned to worship the sungod, or whatever. In the southern hemisphere of course it means winter where in the northern hemisphere we'll have summer.

0 comments

Venus transit approaching / clouds?

June 3th, 2012

On June 8th, 2004 I was at my parents house and my mom and I looked at the sun in a very rudamentary way. We held binoculars at the sun and used a sheet of paper on the other end to make out a tiny dot that was venus. Never look directly at the sun, or you'll have sight problems later. So on June 5th and 6th (depending where you are) Venus will transit the suns disk again and supposedly we won't see this event repeating from happening for a few generations, so it may be worth it to take a look. It looks like we'll have clouds here but there is a chance for it to clear up.

All sorts of telescopes will study venus from earth as the atmosphere will likely be illuminated by the sun and we'll see details of how thick the atmosphere may be. Who knows, there may be other science experiments that could be done. Have fun to anyone looking at this solar system event. Also have fun reading about it on the Internet, the best virtual telescope on earth. I know I will.

0 comments

Home network fully at OpenBSD 5.1

June 2nd, 2012

This morning I upgraded uranus to 5.1 and it took about 2.5-3 hours with all the packages being upgraded and such. This is usually such a pain that I don't want to run -current and wait for the OpenBSD releases every year.

Oh yes I also upgraded libcrypto after the errata for 5.1.

0 comments

World IPv6 day is soon

June 1st, 2012

0 comments

Ordered 4 books (I know, I know)

May 27th, 2012

Now that I'm making a fairly good income I gotta put my money somewhere so I invested it into education. I bought four books that will help me with my trait. One of them is:

Building Telephony Systems...

I think SIP phones are going to be with us for a long time to come. My Grandstream even hinted that it can do IPv6 now, which I have to play with. Oh well.

0 comments

What to do about ports?

May 23rd, 2012

I had moved /usr/ports to /usr/local/ports because it didn't fit anymore. And today I ran out of space on /usr/local.

Script started on Wed May 23 14:50:10 2012
# df
Filesystem  512-blocks	    Used     Avail Capacity  Mounted on
/dev/wd0a      2057756	  125444   1829428     6%    /
/dev/wd0k    209124908	63155652 135513012    32%    /home
/dev/wd0d      8250780	      32   7838212     0%    /tmp
/dev/wd0f      4122108	  961584   2954420    25%    /usr
/dev/wd0g      2057756	  385272   1569600    20%    /usr/X11R6
/dev/wd0h     20636924	19400224    204856    99%    /usr/local
/dev/wd0j      4122108	  321792   3594212     8%    /usr/obj
/dev/wd0i      4122108	 1694272   2221732    43%    /usr/src
/dev/wd0e     38273692	   64000  36296008     0%    /var
# cd /home
# ls
pjp
# mkdir home
# mv pjp home/
# kbd=de.nodead
kbd: keyboard mapping set to de.nodead
# dump -0uaf - /usr/local | (cd /home ; restore -xf -)
  DUMP: Date of this level 0 dump: Wed May 23 14:52:36 2012
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rwd0h (/usr/local) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 9725619 tape blocks.
  DUMP: Volume 1 started at: Wed May 23 14:52:38 2012
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: 22.37% done, finished in 0:17
  DUMP: 51.81% done, finished in 0:09
  DUMP: 92.74% done, finished in 0:01
  DUMP: 10002019 tape blocks
  DUMP: Date of this level 0 dump: Wed May 23 14:52:36 2012
  DUMP: Volume 1 completed at: Wed May 23 15:08:46 2012
  DUMP: Volume 1 took 0:16:08
  DUMP: Volume 1 transfer rate: 10332 KB/s
  DUMP: Date this dump completed:  Wed May 23 15:08:46 2012
  DUMP: Average transfer rate: 10332 KB/s
  DUMP: level 0 dump on Wed May 23 14:52:36 2012
  DUMP: DUMP IS DONE
set owner/mode for '.'? [yn] y
# pwd
/home
# ls
bin	include lib	libexec ports	share
home	info	libdata man	sbin
# ls home
pjp
# df -h .
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0k     99.7G   39.4G   55.4G    42%    /home
# df
Filesystem  512-blocks	    Used     Avail Capacity  Mounted on
/dev/wd0a      2057756	  125452   1829420     6%    /
/dev/wd0k    209124908	82555840 116112824    42%    /home
/dev/wd0d      8250780	      32   7838212     0%    /tmp
/dev/wd0f      4122108	  961584   2954420    25%    /usr
/dev/wd0g      2057756	  385272   1569600    20%    /usr/X11R6
/dev/wd0h     20636924	19400224    204856    99%    /usr/local
/dev/wd0j      4122108	  321792   3594212     8%    /usr/obj
/dev/wd0i      4122108	 1694272   2221732    43%    /usr/src
/dev/wd0e     38273692	   64000  36296008     0%    /var
# umount /usr/src /usr/obj
# df
Filesystem  512-blocks	    Used     Avail Capacity  Mounted on
/dev/wd0a      2057756	  125452   1829420     6%    /
/dev/wd0k    209124908	82555840 116112824    42%    /home
/dev/wd0d      8250780	      32   7838212     0%    /tmp
/dev/wd0f      4122108	  961584   2954420    25%    /usr
/dev/wd0g      2057756	  385272   1569600    20%    /usr/X11R6
/dev/wd0h     20636924	19400224    204856    99%    /usr/local
/dev/wd0e     38273692	   64000  36296008     0%    /var
# umount /usr/local /usr/X11R6 /usr
umount: /usr: Device busy
# df
Filesystem  512-blocks	    Used     Avail Capacity  Mounted on
/dev/wd0a      2057756	  125452   1829420     6%    /
/dev/wd0k    209124908	82555840 116112824    42%    /home
/dev/wd0d      8250780	      32   7838212     0%    /tmp
/dev/wd0f      4122108	  961584   2954420    25%    /usr
/dev/wd0e     38273692	   64000  36296008     0%    /var
# exit

Script done on Wed May 23 15:10:07 2012

At that point I unfortunately had to kill the typescript since it was on the /usr filesystem and I needed to unmount it. What I did was something along the lines of.

umount /usr
disklabel wd0 # and do some math
export EDITOR=/bin/ed
disklabel -e wd0 # and forget some commands, but it came back to me
newfs /dev/rwd0f
cd /usr ; restore -xf /mnt/backup/j-usr.dump	# I backed up those before hand
cd /usr/X11R6 ; restore -xf /mnt/backup/j-usr-x11r6.dump
vi /etc/fstab		# take out the old parititions
shutdown -r now
In the end my partitions looked like this and I was able to continue building ports in /usr:
jupiter$ df
Filesystem  512-blocks      Used     Avail Capacity  Mounted on
/dev/wd0a      2057756    125456   1829416     6%    /
/dev/wd0d      8250780       236   7838008     0%    /tmp
/dev/wd0f     26829980  14103900  11384584    55%    /usr
/dev/wd0k    209124908  83352904 115315760    42%    /usr/local
/dev/wd0j      4122108    321792   3594212     8%    /usr/obj
/dev/wd0i      4122108   1694272   2221732    43%    /usr/src
/dev/wd0e     38273692     65532  36294476     0%    /var

Putting the ports in the right directory is becoming a real problem for me. And I've put some security of my system at risk because I took out some compartmentization.

0 comments

What's up? Nothing.

May 21st, 2012

May,2012 is probably the least contentious (if that's a word) month in this blog's history. I'm busy working and haven't found anything worth putting up.

0 comments

Next Page

Search

RSS Feed

Click here for RSS

On this day in

Other links

Have feedback?

By clicking on the header of an article you will be served a cookie. If you do not agree to this do not click on the header. Thanks!

Using a text-based webbrowser?

... such as lynx? Welcome back it's working again for the time being.

Older Blog Entries


Powered by BCHS