mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
Weekly_update
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -24,4 +24,39 @@ But we also need some bash script to collect data through different size of rand
|
|||||||
|
|
||||||
### Time Experiment of seafile
|
### Time Experiment of seafile
|
||||||
|
|
||||||
|
Patch is based on seafile 5.1.4. You can find the release from [seafile official repo](https://github.com/haiwen/seafile/releases). You may follow official compile instructions from [here](https://manual.seafile.com/build_seafile/linux.html). \[[Patch]()\]
|
||||||
|
|
||||||
|
#### How to collect data
|
||||||
|
|
||||||
|
We also need everything be done using scripting. But this time I only design added some distance between two increasing files' sizes.
|
||||||
|
|
||||||
|
- Start from 8K to 16M, 4 times increasing, modify at beginning/ at 1024 different places with python script. \[[Bash Script](/static/2016-11/seafile/trans.sh)\|[Python program](/static/2016-11/seafile/addbyte.py)\]
|
||||||
|
- After using this auto testing script, everything of output will be marked in log files of seafile, which located in **~/.ccnet/log/seafile.log**
|
||||||
|
- We need to use this simple awk code and vim operation to extract data.
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
# CDC: content defined chucks
|
||||||
|
# HUT: Http upload traffic
|
||||||
|
# ALL: overall time of one commit & upload
|
||||||
|
awk '/CDC|HUT|ALL/ {print $4,$5}' ~/.ccnet/log/seafile.log > results.stat
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
|
||||||
|
#### Install Seafile on odroid xu
|
||||||
|
|
||||||
|
Due to failure of my cross-compile to seafile on android. I used develop board as a replacement experiment platform for ARM-seafile testing. I used a [odroid xu](http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137510300620) as hardware standard. Because all I need is an ARM platform, only an ARM-Ubuntu is enough for me. But develop prototype on a board is much fun than coding, I won't address much this time. But I'll start a blog telling some really cool stuff I made for a strange aim.
|
||||||
|
|
||||||
|
To install a ubuntu with GUI is my all preparation work. I found to way to do this.
|
||||||
|
|
||||||
|
- [armhf](http://www.armhf.com/boards/odroid-xu/) is a website for arm-based ubuntu. It has a detailed instruction to follow at [here](http://www.armhf.com/boards/odroid-xu/odroid-sd-install/). They also provide ubuntu 12.04/ 14.04 and debian 7.5 to choose. But unfortunately odroid xu's hdmi output doesn't supported by ubuntu native firmware. So install ubuntu-desktop might can't be boot up for video output.
|
||||||
|
|
||||||
|
- Burn images is much easy to install a pre-complied ubuntu system. I found this on odroid xu's forum, which contains xubuntu image \[[download](http://odroid.in/ubuntu_14.04lts/ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz)\] for odroid xu. With this image, you just need to use dd command to write whole system mirror into sdcard.
|
||||||
|
|
||||||
|
~~~~bash
|
||||||
|
# If .img end with xz, use this command to uncompress first
|
||||||
|
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
|
||||||
|
# Burn image into SD-card
|
||||||
|
sudo dd if=ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img of=/dev/sdb bs=1M conv=fsync
|
||||||
|
sync
|
||||||
|
~~~~
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,48 @@ But we also need some bash script to collect data through different size of rand
|
|||||||
|
|
||||||
<h3 id="time-experiment-of-seafile">Time Experiment of seafile</h3>
|
<h3 id="time-experiment-of-seafile">Time Experiment of seafile</h3>
|
||||||
|
|
||||||
|
<p>Patch is based on seafile 5.1.4. You can find the release from <a href="https://github.com/haiwen/seafile/releases">seafile official repo</a>. You may follow official compile instructions from <a href="https://manual.seafile.com/build_seafile/linux.html">here</a>. [<a href="">Patch</a>]</p>
|
||||||
|
|
||||||
|
<h4 id="how-to-collect-data-1">How to collect data</h4>
|
||||||
|
|
||||||
|
<p>We also need everything be done using scripting. But this time I only design added some distance between two increasing files’ sizes.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Start from 8K to 16M, 4 times increasing, modify at beginning/ at 1024 different places with python script. [<a href="/static/2016-11/seafile/trans.sh">Bash Script</a>|<a href="/static/2016-11/seafile/addbyte.py">Python program</a>]</li>
|
||||||
|
<li>After using this auto testing script, everything of output will be marked in log files of seafile, which located in <strong>~/.ccnet/log/seafile.log</strong></li>
|
||||||
|
<li>We need to use this simple awk code and vim operation to extract data.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="highlighter-rouge"><pre class="highlight"><code><span class="c"># CDC: content defined chucks</span>
|
||||||
|
<span class="c"># HUT: Http upload traffic</span>
|
||||||
|
<span class="c"># ALL: overall time of one commit & upload</span>
|
||||||
|
awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log > results.stat
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h4>
|
||||||
|
|
||||||
|
<p>Due to failure of my cross-compile to seafile on android. I used develop board as a replacement experiment platform for ARM-seafile testing. I used a <a href="http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137510300620">odroid xu</a> as hardware standard. Because all I need is an ARM platform, only an ARM-Ubuntu is enough for me. But develop prototype on a board is much fun than coding, I won’t address much this time. But I’ll start a blog telling some really cool stuff I made for a strange aim.</p>
|
||||||
|
|
||||||
|
<p>To install a ubuntu with GUI is my all preparation work. I found to way to do this.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p><a href="http://www.armhf.com/boards/odroid-xu/">armhf</a> is a website for arm-based ubuntu. It has a detailed instruction to follow at <a href="http://www.armhf.com/boards/odroid-xu/odroid-sd-install/">here</a>. They also provide ubuntu 12.04/ 14.04 and debian 7.5 to choose. But unfortunately odroid xu’s hdmi output doesn’t supported by ubuntu native firmware. So install ubuntu-desktop might can’t be boot up for video output.</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Burn images is much easy to install a pre-complied ubuntu system. I found this on odroid xu’s forum, which contains xubuntu image [<a href="http://odroid.in/ubuntu_14.04lts/ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz">download</a>] for odroid xu. With this image, you just need to use dd command to write whole system mirror into sdcard.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="highlighter-rouge"><pre class="highlight"><code><span class="c"># If .img end with xz, use this command to uncompress first</span>
|
||||||
|
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
|
||||||
|
<span class="c"># Burn image into SD-card</span>
|
||||||
|
sudo dd <span class="k">if</span><span class="o">=</span>ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img <span class="nv">of</span><span class="o">=</span>/dev/sdb <span class="nv">bs</span><span class="o">=</span>1M <span class="nv">conv</span><span class="o">=</span>fsync
|
||||||
|
sync
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
|||||||
+44
-2
@@ -6,8 +6,8 @@
|
|||||||
</description>
|
</description>
|
||||||
<link>https://codersherlock.github.com//</link>
|
<link>https://codersherlock.github.com//</link>
|
||||||
<atom:link href="https://codersherlock.github.com//feed.xml" rel="self" type="application/rss+xml"/>
|
<atom:link href="https://codersherlock.github.com//feed.xml" rel="self" type="application/rss+xml"/>
|
||||||
<pubDate>Mon, 31 Oct 2016 17:08:36 -0400</pubDate>
|
<pubDate>Thu, 03 Nov 2016 00:20:36 -0400</pubDate>
|
||||||
<lastBuildDate>Mon, 31 Oct 2016 17:08:36 -0400</lastBuildDate>
|
<lastBuildDate>Thu, 03 Nov 2016 00:20:36 -0400</lastBuildDate>
|
||||||
<generator>Jekyll v3.0.1</generator>
|
<generator>Jekyll v3.0.1</generator>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
@@ -33,6 +33,48 @@ But we also need some bash script to collect data through different size of rand
|
|||||||
|
|
||||||
<h3 id="time-experiment-of-seafile">Time Experiment of seafile</h3>
|
<h3 id="time-experiment-of-seafile">Time Experiment of seafile</h3>
|
||||||
|
|
||||||
|
<p>Patch is based on seafile 5.1.4. You can find the release from <a href="https://github.com/haiwen/seafile/releases">seafile official repo</a>. You may follow official compile instructions from <a href="https://manual.seafile.com/build_seafile/linux.html">here</a>. [<a href="">Patch</a>]</p>
|
||||||
|
|
||||||
|
<h4 id="how-to-collect-data-1">How to collect data</h4>
|
||||||
|
|
||||||
|
<p>We also need everything be done using scripting. But this time I only design added some distance between two increasing files’ sizes.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>Start from 8K to 16M, 4 times increasing, modify at beginning/ at 1024 different places with python script. [<a href="/static/2016-11/seafile/trans.sh">Bash Script</a>|<a href="/static/2016-11/seafile/addbyte.py">Python program</a>]</li>
|
||||||
|
<li>After using this auto testing script, everything of output will be marked in log files of seafile, which located in <strong>~/.ccnet/log/seafile.log</strong></li>
|
||||||
|
<li>We need to use this simple awk code and vim operation to extract data.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="highlighter-rouge"><pre class="highlight"><code><span class="c"># CDC: content defined chucks</span>
|
||||||
|
<span class="c"># HUT: Http upload traffic</span>
|
||||||
|
<span class="c"># ALL: overall time of one commit &amp; upload</span>
|
||||||
|
awk <span class="s1">'/CDC|HUT|ALL/ {print $4,$5}'</span> ~/.ccnet/log/seafile.log &gt; results.stat
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4 id="install-seafile-on-odroid-xu">Install Seafile on odroid xu</h4>
|
||||||
|
|
||||||
|
<p>Due to failure of my cross-compile to seafile on android. I used develop board as a replacement experiment platform for ARM-seafile testing. I used a <a href="http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137510300620">odroid xu</a> as hardware standard. Because all I need is an ARM platform, only an ARM-Ubuntu is enough for me. But develop prototype on a board is much fun than coding, I won’t address much this time. But I’ll start a blog telling some really cool stuff I made for a strange aim.</p>
|
||||||
|
|
||||||
|
<p>To install a ubuntu with GUI is my all preparation work. I found to way to do this.</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p><a href="http://www.armhf.com/boards/odroid-xu/">armhf</a> is a website for arm-based ubuntu. It has a detailed instruction to follow at <a href="http://www.armhf.com/boards/odroid-xu/odroid-sd-install/">here</a>. They also provide ubuntu 12.04/ 14.04 and debian 7.5 to choose. But unfortunately odroid xu’s hdmi output doesn’t supported by ubuntu native firmware. So install ubuntu-desktop might can’t be boot up for video output.</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Burn images is much easy to install a pre-complied ubuntu system. I found this on odroid xu’s forum, which contains xubuntu image [<a href="http://odroid.in/ubuntu_14.04lts/ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz">download</a>] for odroid xu. With this image, you just need to use dd command to write whole system mirror into sdcard.</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="highlighter-rouge"><pre class="highlight"><code><span class="c"># If .img end with xz, use this command to uncompress first</span>
|
||||||
|
unxz ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img.xz
|
||||||
|
<span class="c"># Burn image into SD-card</span>
|
||||||
|
sudo dd <span class="k">if</span><span class="o">=</span>ubuntu-14.04lts-xubuntu-odroid-xu-20140714.img <span class="nv">of</span><span class="o">=</span>/dev/sdb <span class="nv">bs</span><span class="o">=</span>1M <span class="nv">conv</span><span class="o">=</span>fsync
|
||||||
|
sync
|
||||||
|
</code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
</description>
|
</description>
|
||||||
<pubDate>Fri, 28 Oct 2016 12:27:33 -0400</pubDate>
|
<pubDate>Fri, 28 Oct 2016 12:27:33 -0400</pubDate>
|
||||||
<link>https://codersherlock.github.com//archivers/some-of-my-previews-exper-work</link>
|
<link>https://codersherlock.github.com//archivers/some-of-my-previews-exper-work</link>
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import sys
|
||||||
|
from subprocess import call
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import math
|
||||||
|
import random
|
||||||
|
|
||||||
|
hostfile = open(sys.argv[1],'r')
|
||||||
|
guestfile = open(sys.argv[2],'r')
|
||||||
|
targetfile = open(sys.argv[3],'w+')
|
||||||
|
|
||||||
|
guest = guestfile.read()
|
||||||
|
target = hostfile.read()
|
||||||
|
byte_ndx = 0
|
||||||
|
flt_byte = 0
|
||||||
|
for i in range(0,len(guest)):
|
||||||
|
loc=random.randint(0,len(target)-1)
|
||||||
|
target = target[:loc]+guest[i]+target[loc:]
|
||||||
|
|
||||||
|
targetfile.write(target)
|
||||||
|
hostfile.close()
|
||||||
|
guestfile.close()
|
||||||
|
targetfile.close()
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#### THIS IS A SMALL TRANS SCRIPT ####
|
||||||
|
|
||||||
|
PREFIX=$1
|
||||||
|
echo $PREFIX
|
||||||
|
STARTSIZE=1024*8
|
||||||
|
|
||||||
|
let FILESIZE=$STARTSIZE/2
|
||||||
|
|
||||||
|
for i in `seq 1 6`;
|
||||||
|
do
|
||||||
|
let FILESIZE=$FILESIZE*4
|
||||||
|
let CHANGESIZE=1024
|
||||||
|
|
||||||
|
dd if=/dev/urandom of=$PREFIX.$FILESIZE.dat bs=$FILESIZE count=1
|
||||||
|
cp $PREFIX.$FILESIZE.dat ./FUCK/$PREFIX.$FILESIZE.dat
|
||||||
|
sleep 15s
|
||||||
|
dd if=/dev/urandom of=$CHANGESIZE.dat bs=$CHANGESIZE count=1
|
||||||
|
cat $CHANGESIZE.dat $PREFIX.$FILESIZE.dat > $PREFIX.$FILESIZE.m.dat
|
||||||
|
#python ./addbyte.py $PREFIX.$FILESIZE.dat $CHANGESIZE.dat $PREFIX.$FILESIZE.m.dat
|
||||||
|
cp $PREFIX.$FILESIZE.m.dat ./FUCK/$PREFIX.$FILESIZE.dat
|
||||||
|
sleep 15s
|
||||||
|
|
||||||
|
done
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Hide informations in static documents
|
||||||
|
|
||||||
|
foldername = "../../static"
|
||||||
|
|
||||||
|
print(foldername)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pyopenssl
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import sys
|
||||||
|
from subprocess import call
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import math
|
||||||
|
import random
|
||||||
|
|
||||||
|
hostfile = open(sys.argv[1],'r')
|
||||||
|
guestfile = open(sys.argv[2],'r')
|
||||||
|
targetfile = open(sys.argv[3],'w+')
|
||||||
|
|
||||||
|
guest = guestfile.read()
|
||||||
|
target = hostfile.read()
|
||||||
|
byte_ndx = 0
|
||||||
|
flt_byte = 0
|
||||||
|
for i in range(0,len(guest)):
|
||||||
|
loc=random.randint(0,len(target)-1)
|
||||||
|
target = target[:loc]+guest[i]+target[loc:]
|
||||||
|
|
||||||
|
targetfile.write(target)
|
||||||
|
hostfile.close()
|
||||||
|
guestfile.close()
|
||||||
|
targetfile.close()
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#### THIS IS A SMALL TRANS SCRIPT ####
|
||||||
|
|
||||||
|
PREFIX=$1
|
||||||
|
echo $PREFIX
|
||||||
|
STARTSIZE=1024*8
|
||||||
|
|
||||||
|
let FILESIZE=$STARTSIZE/2
|
||||||
|
|
||||||
|
for i in `seq 1 6`;
|
||||||
|
do
|
||||||
|
let FILESIZE=$FILESIZE*4
|
||||||
|
let CHANGESIZE=1024
|
||||||
|
|
||||||
|
dd if=/dev/urandom of=$PREFIX.$FILESIZE.dat bs=$FILESIZE count=1
|
||||||
|
cp $PREFIX.$FILESIZE.dat ./FUCK/$PREFIX.$FILESIZE.dat
|
||||||
|
sleep 15s
|
||||||
|
dd if=/dev/urandom of=$CHANGESIZE.dat bs=$CHANGESIZE count=1
|
||||||
|
cat $CHANGESIZE.dat $PREFIX.$FILESIZE.dat > $PREFIX.$FILESIZE.m.dat
|
||||||
|
#python ./addbyte.py $PREFIX.$FILESIZE.dat $CHANGESIZE.dat $PREFIX.$FILESIZE.m.dat
|
||||||
|
cp $PREFIX.$FILESIZE.m.dat ./FUCK/$PREFIX.$FILESIZE.dat
|
||||||
|
sleep 15s
|
||||||
|
|
||||||
|
done
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Hide informations in static documents
|
||||||
|
|
||||||
|
foldername = "../../static"
|
||||||
|
|
||||||
|
print(foldername)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pyopenssl
|
||||||
Reference in New Issue
Block a user