Tuesday, September 16, 2014

intercepted 550 User not found;

This summary is not available. Please click here to view the post.

Wednesday, September 10, 2014

Use single regular file as a filesystem


Why? it can be for portable,virtual,develop,audit,test,free,... nice things.

make a empty regular file
    dd if=/dev/zero of=myExt4.img bs=4K count=1000

check if loop device available on your system:
    ls /dev/loop*

if there is no loop device, need to load kernel modules, or even compile loop module:

    (Linux 3.16.1)
    make menuconfig
    Device Drivers -> Block Devices -> Loopback device support
    make -j4
    make modules_install
   
    modprobe loop
    ls /dev/loop*

use loop device

    losetup /dev/loop0 myExt4.img
    mkfs.ext4 /dev/loop0
    mount /dev/loop0 /mnt   
    echo "world">/mnt/hello
    df
    umount /mnt

done.



ADD:
use modprobe loop max_part=31
and fdisk /dev/loop0
mkfs /dev/loop0p1
to work on virtual multi-partition disk.

Load your OS kernel by Grub2 in a single file.



BIOS loads MBR in 512 bytes into memory 0000h:7c00h

But grub2 can load a whole file into memory 0000h:7c00h,(with a patch)
that means you can write your hobbist OS in one single file.
In this way, maybe other existing OS can be loaded easily.

in grub1 there is command "kernel=file" but I cannot find it in grub2.
grub2 has command linux16, but has other restriction about the format.
grub2 also provides command multiboot, but also spec condition should be met.

The method mentioned here, need only one condition is, the last 2 bytes of first 512 bytes
should be hex 55AA.

and the kernel file could be put in any existing filesystem can be recognized by grub2.

eg:
menuentry 'NEOS on vfat' {
    insmod chain
    insmod fat
    set root='hd0,msdos4'
    chainloader /neoskern
}
or:
menuentry 'NEOS on ext4' {
    insmod part_msdos
    insmod chain
    insmod ext2
   
    set root='hd0,msdos7'
    chainloader /boot/neoskern
}

the patch info is here: http://savannah.gnu.org/bugs/?43184

Monday, September 1, 2014

8192cu on linux 3.16.1

It is said that 8192cu wifi driver is buggy.
I download driver from the maker site RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
cannot compile because /proc API is changed since 3.10
I found patched versions on the net, they just make the /proc part dummy.
and I see interface wlan1(or wlan0 on yours). but no wireless extension using iwconfig. and Unsupported driver 'nl80211'. and ioctl[SIOCSIWMODE]: Operation not supported if use -DWext. 
At last I found kernel modules for it is just not compiled(I used self-compiled kernel). And I tried default rtl8192cu module of kernel.
It worked.

I just don't know the reason.
But I learned to try kernel drivers.

Monday, August 11, 2014

install wifi usb driver ralink 7601 (FAILED)

This summary is not available. Please click here to view the post.

Wednesday, June 25, 2014

linux sound config

some tips to make your sound work on linux


1. to select a default sound output device, edit /etc/asound.conf or ~/.asoundrc to
pcm.!default {
    type hw
    card 0
}

ctl.!default {
    type hw          
    card 0
}
2. if it says permission denied, and only can play sound by root.

 try:
 chmod a+rw /dec/snd/*

Monday, June 23, 2014

Linux make on Windows

Yes, I like Linux as a ideal programming environment.
there are always source code available.

Also I found mingw is wonderful, it can build and bring Linux library to Windows.

But soon I found it also bring the Linux "./configure make make install" nightmare into Windows,
for, I'm a Java lover.


Thursday, June 12, 2014

window manager select

Selecting a window manager for my desktop is like the feeling of shopping.

first, I go to find out
what is window system(/ display server)
what is window manager
what is Gnome, KDE
what is GTK, QT
where is it and what is the alternatives.

they are confusing,  because they are designed to be confusing, but nothing can stop you to make them clear. even themselves for confusing.

ok, at last.
My selection is Openbox + tint2 + conky + neoeedit

I tried alot of others, whatever what they are saying, they are just advertisement. I must try myself. They are like shoes, maybe they are good, but not fit for me.

PS, window manage is just a small piece of program, simple one only need about 1000 lines of code. They let you can do things like move/scale window, event dispatch to window. so, just keep it simple. However, applications in the window will stay the same. like Firefox, neoeedit, konsole, whatever, they are the same regardless what window manager you choose.

Monday, May 26, 2014

FlashPlayer plugin stay in memory

It is most likely ad-ware something, the flashplayer plugin kept in memory even after webpage is closed.
The bad thing is they take up memory, what's more harmful, they keep accessing the internet, keeping downloading and uploading something sneaky. If you find your CPU usage high, they are maybe using your CPU for mining coins! The worst case is using unknown vulnerability to reading your local files!

I like to use Firefox for browsing, a pity, the problem occur on both Windows and Freebsd, likely on Linux.
On windows, there are 1 or 2 process named something like flashplayerplugin, you can kill them in task-manager. Most time they will quit when Firefox is closed.
On Freebsd or Linux, they stay as processes even after Firefox is closed.
eg, I viewed some p0rn sites and after that, I found 300+ processes of flashplayerplugin! wtf...

so there is a shell script to kill them all, like this:

#!/bin/sh
ps auxw | awk '/[\/]libflashplayer/{print $0}'
cnt=`ps auxw | awk '/[\/]libflashplayer/{print $2}' | wc -l`
echo $cnt
if [ $cnt != 0 ]
then
    kill `ps auxw | awk '/[\/]libflashplayer/{print $2}'`
    sleep 1
fi
ps auxw | awk '/[\/]libflashplayer/{print $2}' | wc -l

I really hate swf things, swf can access various sites at once as ad-ware.
but we have to use them watching video before they are replaced by HTML5 video. They also silently embedded in the webpages of some evil sites, even technical sites like solidot.org. Fuck them all.
Just keep a sight on them.

Tuesday, March 25, 2014

JavaFX good

As JDK8 release I checked Java again. Even the blind people can see JavaFX. I looked a little at the demo and codes. I think it rocks. I like it.

Saturday, January 4, 2014

OpenCL is great

I learned OpenCL and practiced some example.

The performance is great.

the test case is http://code.google.com/p/neoe-vm/wiki/NeoeVmBenchmarkEx1

Java Single Thread cost 1unit time
Java Multi-Thread(100000 threads) cost 2x time.
Java Multi-Thread(32 threads) cost 0.36x time.
OpenCl CPU-mode cost 0.36x time(almost the same as using thread).
OpenCl GPU-mode cost 0.08x time (12.5x faster, I expected better but still great because its impossible without a GPU)

Video card is GTX560, maybe Ati card will have better result(though I didnot have one to test with).
CPU is intel E5462.

OpenCl language is like C language, so porting program to opencl should be easy, If the program has a parallel mode.