Centroid.EU Blog
(this blog is mostly encrypted - adults only)
|
Previous Page
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
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
November, 2023
October, 2023
September, 2023
August, 2023
July, 2023
June, 2023
May, 2023
April, 2023
March, 2023
February, 2023
January, 2023
December, 2022
November, 2022
October, 2022
September, 2022
August, 2022
July, 2022
June, 2022
May, 2022
April, 2022
March, 2022
February, 2022
January, 2022
December, 2021
November, 2021
October, 2021
September, 2021
March, 2021
February, 2021
January, 2021
December, 2020
November, 2020
October, 2020
September, 2020
August, 2020
July, 2020
June, 2020
May, 2020
April, 2020
March, 2020
February, 2020
January, 2020
December, 2019
November, 2019
October, 2019
September, 2019
August, 2019
July, 2019
June, 2019
May, 2019
April, 2019
March, 2019
February, 2019
January, 2019
December, 2018
November, 2018
October, 2018
September, 2018
August, 2018
July, 2018
June, 2018
May, 2018
April, 2018
March, 2018
February, 2018
January, 2018
December, 2017
November, 2017
October, 2017
September, 2017
August, 2017
July, 2017
June, 2017
May, 2017
April, 2017
March, 2017
February, 2017
January, 2017
December, 2016
November, 2016
October, 2016
September, 2016
August, 2016
July, 2016
June, 2016
May, 2016
April, 2016
March, 2016
February, 2016
January, 2016
December, 2015
November, 2015
October, 2015
September, 2015
August, 2015
July, 2015
June, 2015
May, 2015
April, 2015
March, 2015
February, 2015
January, 2015
December, 2014
November, 2014
October, 2014
September, 2014
August, 2014
July, 2014
June, 2014
May, 2014
April, 2014
March, 2014
February, 2014
January, 2014
December, 2013
November, 2013
October, 2013
September, 2013
August, 2013
July, 2013
June, 2013
May, 2013
April, 2013
March, 2013
February, 2013
January, 2013
December, 2012
November, 2012
October, 2012
September, 2012
August, 2012
July, 2012
June, 2012
May, 2012
April, 2012
March, 2012
February, 2012
January, 2012
December, 2011
November, 2011
October, 2011
September, 2011
August, 2011
July, 2011
June, 2011
May, 2011
April, 2011
March, 2011
February, 2011
January, 2011
December, 2010
November, 2010
October, 2010
September, 2010
August, 2010
July, 2010
June, 2010
May, 2010
April, 2010
March, 2010
February, 2010
January, 2010
December, 2009
November, 2009
October, 2009
September, 2009
August, 2009
July, 2009
June, 2009
May, 2009
Powered by BCHS
|