Centroid.EU Blog
(this blog is mostly encrypted - adults only)
|
Previous Page
October 17th, 2012
I thought of these myself last night, please provide comments if you have
another idea.
2 rate limiting algorithms
--------------------------
Pretend you want to rate limit 3 packets per 6 seconds on the Internet.
I have thought of two ways to do this, one using 1 timestamp and a counter,
and the other using several timestamps and a counter which is more accurate.
First way
---------
When you have a packet arriving you take the timestamp of it. For the next
six seconds you can take on 2 more packets. Once the six seconds expired
you save the new timestamp and allow 3 more packets. This has the drawback
that you can fire off a packet, wait 5 seconds and fire off 2 more, then when
the sixth second is passed you send off 3 more packets so in 7 seconds you can
fire off 6 packets which isn't exactly what the rate of packets per second
says. However given 12 seconds it averages out because you wait 5 seconds from
those passed 7 seconds and don't allow anymore packets during that time. Then
on the 13th second you can fire off 3 more packets.
Second way
----------
To alleviate the "burst" problem of above you can add more memory resources
and add more timestamps. You allocate 3 timestamps for 3 packets per 6 seconds.
Then you make two counters. One for the position of the last timestamp and
one for the amount of packets that passed. So then when you start this
you send a packet and it saves the timestamp in timestamp[counter1] it then
increases counter1 and counter2. Next packet comes in a second later, it
checks timestamp[counter1 - counter2] if it has been under 6 seconds then
add the timestamp to timestap[counter1] and increase both counter1 and
counter2. 5 seconds later another packet comes in, the first timestamp is now
"expired" and gets set to 0, also counter2 gets decreased by one. This
ensures that we know how many timestamps exist. We then check
timestamp[counter1 - counter2] and if the offset in time is under 6 seconds
then we add another timestamp in timestamp[counter1]. The tricky part is
to deal with wrap-arounds. Ie. if you have 3 timestamps you can only fill
timestamp[0], timestamp[1], timestamp[2] before going back to timestamp[0],
which likely has been blanked otherwise the packet is dropped.
I invite you to provide clarifications and addendums,
-peter
:-)
0 comments
Seti@home has failed
October 13th, 2012
I got this in the mail the other day:
We need your help to continue the Search for Extraterrestrial Intelligence!
I guess the millions of people contributing computer cycles over the last 15
years is not enough anymore. Now the organization wants money. I think this
is the wrong approach. Look, they got millions of people happily contributing
on a client-server setup. Their servers are failing and they can't get more
and they ask for money (which they likely won't get). It's time to make
seti@home peer-to-peer. Figure out a way and people shall follow by installing
the software. And the 'net will be better for it. That's my 2 cents.
0 comments
One computer per year
October 11th, 2012
I've done some planning and I've come to the conclusion that I need one more
computer per year until 2016. See my computing history from april. Here is how I think it
will go down:
- in 2013, I'm going to buy Gaia a mac mini most likely, I need this for my
new stand up table, I'll see if I can switch Saturn my netbook to OpenBSD then
- in 2014, I'm going to retire mars (G4 Cube) and make Gaia its replacement,
I'm also going to retire Jupiter which will be 4 years old and buy a replacement
and call this Venus. Venus should have over 8 GB RAM but a power saving cpu.
- in 2015, I'm likely going to need a laptop perhaps, I'll call this Mercury
This basically puts me on track since 2010 for 1 new computer per year, I think
I'm crazy perhaps (well I knew that). Since electricity in Germany is going to
get more expensive, it is good then that I retire Mars and I'm hoping for Gaia
to be power saving (at max cpu 85 watts apple says, but no indicator of idle
power). Also Jupiters replacement, Venus should be power saving this will save
me a bundle of money. I'm considering putting 1500 euros per year aside for
these "toys", and since I'm not married yet I don't have to worry about supporting the kids ;).
0 comments
My top 8 genres in my iTunes collection
October 5th, 2012
Here is who I threw money at in the last 10 years. Each song is about 99 cents
worth. The way I did this was select all songs in itunes and pasted the titles
in an editor file. This file I then uploaded to a Unix computer and did the
following command.
# awk '{print $(NF - 1)}' music.txt| grep -v [0-9] | sort | uniq -c | sort -r | head -8
125 Reggae
33 Hip-Hop/Rap
22 Filmmusik
19 Weltmusik
17 Rock
11 Pop
7 Sound
7 R&B
However I get most other music from youtube, until I decide to give the artist
a bit of money.
0 comments
The big smoggies...VPS's though?
October 2nd, 2012
Internet datacenters are big smoggies. Often servers sit there idling doing
nothing but waiting to take over a redundancy task. I'd just like to say that
my VPS network that I have created is on a X users shared basis, where more
than one customer resides on a server. They each borrow from the other
in terms of resources. And that's why I don't run permanent load on my vps's
because it suits the other guy as well. And in the end we have more than
just an idle server. We have a community on that server. And it's greener
than me going out and putting up a colo or a "root server" (dedicated).
The new york times wrote about that all computers on the internet use up enough
electricity for 30 nuclear power plants. Not all of that electricity comes
from green electricity but carbon oxided emissions such as coal. The way
we use the internet is not sustainable ... virtualization helps though if only
a little.
0 comments
Bad Cryptography: a one time pad
October 1st, 2012
When I put my backups on the online storage I "encrypt" the file twice. Once
with AES 256 in CBC mode and once with a one time pad that unfortunately
repeats so it's supposedly insecure. I want to share this one time pad with
you as it's derived from the one time pad at
hackepedia.
#include
#include
#include
#include
#include
#include
#include
#include
#define BLOCKSIZE 512
int
main(int argc, char *argv[])
{
uint64_t count = 0;
int keylen;
char *key;
u_char c[BLOCKSIZE];
struct stat sb;
char *ch;
int fd, len, i;
if (argc != 2) {
fprintf(stderr, "must provide a keyfile\n");
exit(1);
}
if (lstat(argv[1], &sb) < 0) {
perror("lstat");
exit(1);
}
fd = open(argv[1], O_RDONLY, 0);
if (fd < 0) {
perror("open");
exit(1);
}
if ((ch = mmap(NULL, sb.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0)) == MAP_FAILED) {
perror("mmap");
exit(1);
}
while ((len = read(STDIN_FILENO, c, sizeof(c))) > 0) {
for (i = 0; i < len ; i++) {
c[i] ^= ch[count % sb.st_size];
count++;
}
write(STDOUT_FILENO, c, len);
}
munmap(ch, sb.st_size);
close(fd);
return 0;
}
When I back up then it looks something like this in a pipeline
tar -cf - /data | ./onetime onetimefile | openssl enc -e -aes-256-cbc -kfile kfile \
| gzip -c | upload-program
I am gambling somewhat whether this is secure, but I'd feel a little naked
with just an AES-CBC encryption.
0 comments
Purchased online-backup storage
September 30th, 2012
September seems to be a purchasing month for me. I have purchased 20 GB of
online storage (at 1.49 euros per month) from strato.de. They are located in
Berlin and I intend to use them as a temporary storage for my VPS.
On mondays I'll back up moon.virgostar.net, on wednesdays I'll back up
goldflipper.net and on fridays I'll back up io.solarscale.de or something of
this order. On the days inbetween those backups I'll download the images
home on my harddrive. I think something of the order of 700 GB max will flow
between me and this backup storage (per month). Should be worth it.
0 comments
Old --> New
September 23rd, 2012
I exchanged the first picture with the second picture in my private section of
my webpage centroid.eu.
Even though I could lose a few lbs I think I'm still a pretty lad.
0 comments
Privacy: they know who you are anyways
September 21st, 2012
Ever since I had a fire in my apartment building I've been couching at my
parents house. I noticed that youtube and google know exactly who I am
whenever I return to their site. Even the same banners over and over on
slashdot revealed to me that they can track me. The big difference between
my house and my parents house is that they have a dynamic IP address and
I have a static IP. So what's the difference? With a static IP I even
get to run a "server" doing my own mail and knowing that my mail isn't kept
on some shady server somewhere, it's right at home instead. The privacy
with a static IP is protected more I'd argue than with a dynamic IP. This
surprises even me.
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
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
|