LifeDebuger stuff

тра 18, 2017

Hot to exchange data between qemu and host machine

At host machine

  1. install nfs-common, nfs-kernel-server
sudo apt-get install nfs-common nfs-kernel-server

  1. configure nfs server (nfs dir: for example /srv/nfs)
  2. start nfs server
sudo service nfs-server start

  1. start qemu machine .... with some specific options:
qemu-system-i386 -no-reboot -kernel vmlinux-2.6.32-5-686 -hda debian_squeeze_i386_standard.qcow2 -append "root=/dev/sda1 console=tty0" -initrd initrd.img-2.6.32-5-686 -redir tcp:2222::22

At virtual machine

mkdir /tmp/t
mount 10.0.2.2:/srv/nfs /tmp/t
ls /tmp/t

posted at 15:20  ·   ·  nfs  qemu

бер 28, 2017

Hot to create blog in Pelican, hosted on github pages

Create repo

Firstly, create a github page by creating a github repository and name it USERNAME.github.io

git clone https://github.com/USERNAME/USERNAME.github.io.git
cd USERNAME.github.io.git
python -m virtualenv --no-site-packages -p /usr/bin/python .env
source .env/bin/activate
git checkout -b source
pip install pelican
pip install Markdown
pip install ghp-import

git clone --recursive https://github.com/getpelican/pelican-plugins
git clone --recursive https://github.com/getpelican/pelican-themes

pelican-quickstart

Answer some questions .... > Where do you want to create your new web site? [.] > What will be the title of this web site? Buttermilch > Who will be the author of this web site? Tony Stark > What will be the default language of this web site? [en] > Do you want to specify a URL prefix? e.g., http://example.com (Y/n) n > Do you want to enable article pagination? (Y/n) > How many articles per page do you want? [10] > Do you want to generate a Fabfile/Makefile ... and publishing? (Y/n) > Do you want an auto-reload & simpleHTTP ... and site development? (Y/n) > Do you want to upload your website using FTP? (y/N) > Do you want to upload your website using SSH? (y/N) > Do you want to upload your website using Dropbox? (y/N) > Do you want to upload your website using S3? (y/N) > Do you want to upload your website using Rackspace Cloud Files? (y/N)

Edit pelicanconf.py

configure plugins ... setup nessesary python packages ...

Create a Markdown Post

vi content/test.md

Title: Buttermilch is awesome
Date: 2013-08-22 16:08
Category: Python
Tags: python
Author: Tony Stark
Summary: Buttermilch is super cool.

Buttermilch is super cool.

Create a rst Post

vi content/test1.rst

My super title
##############

:date: 2010-10-03 10:20
:modified: 2010-10-04 18:40
:tags: thats, awesome
:category: yeah
:slug: my-super-post
:authors: Alexis Metaireau, Conan Doyle
:summary: Short version for index and feeds

Buttermilch is super cool.

Test your localhost site

make html
make serve

Save and push to github

git branch gh-pages
ghp-import output
git checkout master
git merge gh-pages
git push --all

ENJOI!

бер 28, 2017

Hot to setup remote git server

Hot to setup remote git server ?

  1. Get/Generate custom ssh keys.
  2. Add information about cutom host ssh keys to ~/.ssh/config file:
host xxx.xxx.xxx.xxx
 HostName xxx.xxx.xxx.xxx
 IdentityFile ~/.ssh/XXX
 User user

  1. At server side create repo:
cd /
mkdir -p /opt/git/repo.git
cd /opt/git/repo.git
git init --bare

  1. At client side make repo:
cd /
mkdir -p ~/repo
cd ~/repo
echo "testdata" > testfile.txt
git add testfile.txt
git commmit -m "initial commit"
git remote add origing ssh://user@xxx.xxx.xxx.xxx:host_port/opt/git/repo.git
git push origing master

posted at 15:20  ·   ·  git  ssh

жов 31, 2014

Summary tool under JavaScript

This algorithm was found in the Internet As at this moment I try to implement add-on for Firefox, and some function I've needed was to summarize web-content.

So the main Idea of the algorithm is to build matrix of mutual sentences intersection which is calculates by counting the same words in two sections and division this count with avarage sentence length in words.

Than we summarize intersactions for every sentence and with this value choise what sentence should be used in summary.

This algorithm I've implemented in javascript, so the source is here

сер 14, 2014

This is the first post

I love python because it gives me powerfull language opportunities and also there is a lot of batteries for the allmost all situations in the life :) This blog is made using GitHub pages and a new for me static site generator named Pelican. I'll do my best to support my content and give interesting information my visitors.

This blog is created via this tutorial