use the following to create archive:
find . -print|cpio -ovcBO <archive path name>
find . -print|cpio -ovcBO <archive path name>
use following to extract it:
cpio -ivI <archive path name>Product Description | |
The
Hitachi Ultrastar A7K2000 hard drive, with a storage capacity of 2 TB,
allows you to store your digital world. Buffer size of 32 MB, enables
this Hitachi hard drive to work at a faster pace. Having a spindle speed
of 7200 rpm, this internal hard drive copies data and writes at a high
speed. With 300 MBps of transfer rate, this Hitachi hard drive
facilitates speedy transfer of files. The SAS 300 interface of this 2 TB
Hard Drive enhances connectivity with other devices. Have your computer
function smoothly with the Hitachi Ultrastar A7K2000 hard drive. | |
Product Identifiers | |
Brand | Hitachi |
Model | HUA721075KLA33 |
MPN | HUA722020ALA330 |
UPC | 102646201817 |
Key Features | |
Enclosure | Internal |
Capacity | 2 TB |
Buffer Size | 32 MB |
Spindle Speed | 7200 RPM |
Interface | SATA, SATA 2 |
Designation | Desktop Computer |
Technical Features | |
Platform | PC |
External Data Transfer Rate | 300 Mbps |
Form Factor | 3.5" |
Seek Time | 8.5 ms |
Dimensions | |
Height | 1.02 in. |
Width | 4.02 in. |
Depth | 5.79 in. |
Weight | 1.5 lbs |
sudo apt-get install librxtx-java
ln -sf /usr/lib/librxtxSerial.so lib/librxtxSerial.so
old bug fix solved it:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1239099636/12
max32 board:
http://digilentinc.com/Products/Detail.cfm?NavPath=2,719,895&Prod=CHIPKIT-MAX32
devkit:
https://github.com/chipKIT32/chipKIT32-MAX/downloads
install gcc-avr
sudo apt-get -y install gcc-avr
cat
command (or the
equally humble copy
under Windows), and finally transcoding back to your
format of choice.
ffmpeg -i input1.avi -sameq intermediate1.mpg
ffmpeg -i input2.avi -sameq intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -sameq output.avi
|
-sameq
or set a reasonably high
bitrate for your intermediate and output files, if you want to preserve
video quality.
mkfifo intermediate1.mpg
mkfifo intermediate2.mpg
ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
cat intermediate1.mpg intermediate2.mpg |\
ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
|
tail
as seen below. Note that when piping through tail
you
must use command grouping, { ;}
, to background properly.
mkfifo temp1.a
mkfifo temp1.v
mkfifo temp2.a
mkfifo temp2.v
mkfifo all.a
mkfifo all.v
ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; } &
cat temp1.a temp2.a > all.a &
cat temp1.v temp2.v > all.v &
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v \
-sameq -y output.flv
rm temp[12].[av] all.[av]
|
g++ main.cpp -Os -s `pkg-config gtk+-2.0 --cflags` `pkg-config gtk+-2.0 --libs`
vmkfstools -i itvmgr41.vmdk -d zeroedthick itvmgr40sp1.vmdk
this gets the tar info from a web site via port 80, pipes it
to tar which in turn expands and stores it
wget -O- http://status.calibre-ebook.com/dist/src | tar xvz
Stolen from calibre installer page for linux os.
remainder of install if one uses the above:
cd calibre* sudo python setup.py install
ethernetN.addressType = “static”
ethernetN.address = “<address>”
.ps
and .eps
, are:
distillerfor PS and EPS
.pdf
are:
info from file ffmpeg -i video.avi
images to file
ffmpeg -f image2 -i image%d.jpg video.mpg
file to images
ffmpeg -i video.mpg image%d.jpg
sound to mp3
ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3
avi to giff ffmpeg -i source_video.avi animated_gif.gif
avi to ntsc
ffmpeg -i source_video.avi -target ntsc-svcd final_video.mpg
cat /proc/diskstats
and note the disks that are detected. I detected sda and its partitions only - i.e., my 160 GB disk. cat /proc/diskstats
At the bottom of the output were the two new disks: sdb and sdc.
sudo fdisk /dev/sdb
The fdisk instruction expects you to "run it" interactively. Typing
in m will give you the menu. As noted in the guiding web page, first
type in n to establish a logic partition (I wrote down the number of
cylinders as told to do). Then I typed in t and was presented with a
list of options. I selected fd as this was to be part of a Raid 1 disk.
I typed w as instructed to save this information.
sudo apt-get install mdadm
I then read the man pages for this instruction carefully. Doing so
one realizes this package is the secret behind setting up a Raid disk
system. I wonder how anyone would do it without it. In the version of
the man pages I read, the instruction has the form: mdadm [mode] <raiddevice> [options] <component-devices>
The mode part is really meant to be the place to put the mode
selection options. In the following instruction --create is such an
option.
sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
and expected a miracle would occur, and it would work. It did not.
The error message said something about md0 not existing. Of course it
did not exist. I was "creating" it. Well, back to the web and a lot of
not-too-helpful "help me" messages and their responses, until I came
across a response that said "use the --auto option." I had read about
that and had wondered about using it but lacked the courage. The
response said that the --auto option is there to break the circle of md0
not being there but the mdadm instruction not functioning if it is not
yet defined. They did not suggest which value to give that option so I
ran the above instruction again with --auto=yes, as follows: sudo mdadm --create --verbose --auto=yes /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
and now the miracle did occur. It worked. watch cat /proc/mdstat
After it has synced, we are now told to format md0 with the
instruction (if you are reinstalling disks that were in a previous Raid 1
configuration and you do not wish to destroy their content, skip this
step): sudo mkfs -t reiserfs /dev/md0
Okay, so what is the option -t reiserfs all about? On to the man
pages for mkfs. Ah, reiserfs is an fstype. It tell us there are lots
of different types of formating from which we can choose. Questions
that occur: what are the options and which should I choose? Using
google again on mkfs, I found Q&A pages noting that the types are
indicated by choosing among installed programs of the form mkfs.fstype
so I ran sudo locate mkfs\.
to see what was in my system of that form. A list popped up that
included ext2, ext3, and so forth but no reiserfs. Back to google. The
best page I found to give me clues as to which to choose is in the
useful web pages at the start of this page. First of all one wants a
type that has journaling. Journaling says that if the system powers
down suddenly and not nicely, one can power up and the system can
directly recover the disk without me having to ask it to fix up all the
inconsistencies it is finding. Yes, I want that. ext3 and reiserfs
have journaling. I finally found a statement that said feiserfs is a
good choice and a newer type than ext3. So, I chose reiserfs. Now does
it exists?sudo mkfs -t reiserfs /dev/md0
and sure enough reiserfs existed and ran successfully. Okay, I could
have just done what I was advised, but I felt better about knowing why. sudo mkdir /back
and then I mounted md0 with the instruction sudo mount /dev/md0 /back
Running the instruction df
listed md0 as having the mount point /back, so everything seems to
have worked. Armed with this general feeling of success, I added the
following line to my /etc/fstab. You need to read about fstab in the
above web page to see what auto, defaults and the two zeros are all
about. The first two arguments are those for running the mount
instruction. /dev/md0 /back auto defaults 0 0
fstab is a file that tells the operating system which disks to mount
automatically when restarting the system. The mount instruction it will
run is sudo mount /dev/md0 /back
So, if you are really curious that this restarting works and if you
will not spoil it for anyone else who may be on your computer at this
time, you could restart your computer and then run df
again. md0 should be there at the mount point called /back.
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz
To restore your system
# gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda conv=sync,noerror bs=64K
view partitions in the image (once uncompressed)
# fdisk -l hda.img > /mnt/sda1/hda_fdisk.info
netcat chatserver
create the chat server on this machine and set it to listen to 3333 TCP port:
$ nc -l 3333
creating a partition image and sending it to a remote machine on-the-fly:
$ dd if=/dev/hdb5 | gzip -9 | nc -l 3333
cat
, pv
, or dd
) and I need
to access separate partitions. Unfortunately, the patch allowing partitions
on loop devices to be accessed via their own device nodes does
not appear to be in the latest (Debian) 2.6.18 kernels — the
loop
module does not have a max_part
modinfo
.
parameter, according to msdos
partition table type, I think I have found the
solution, and the urge to document it for posterity.-o
parameter to
losetup
, which specifies how many bytes into
the disk a given partition starts. Getting this number isn’t
straight forward. Well, it is, if you know how, which is why I am
writing this.$ /sbin/fdisk -lu disk.img
You must set cylinders.
You can do this from the extra functions menu.
Disk disk.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
disk.imgp1 * 63 96389 48163+ 83 Linux
disk.imgp2 96390 2056319 979965 82 Linux swap / Solaris
disk.imgp3 2056320 78140159 38041920 5 Extended
disk.imgp5 2056383 3052349 497983+ 83 Linux
disk.imgp6 3052413 10859939 3903763+ 83 Linux
disk.imgp7 10860003 68372639 28756318+ 83 Linux
disk.imgp8 68372703 76180229 3903763+ 83 Linux
disk.imgp9 76180293 78140159 979933+ 83 Linux
The first few lines is fdisk
complaining not being
able to extract the number of cylinders, since it has to operate on
a file which does not provide an ioctl
interface.fdisk
output.
We know that each sector is 512 bytes, so:10860003 * 512 = 5560321536
Passing this number to losetup
produces the desired
result:# losetup /dev/loop0 disk.img -o $((10860003 * 512))
# file -s /dev/loop0
/dev/loop0: Linux rev 1.0 ext3 filesystem data
# mount /dev/loop0 /mnt
[...]
# umount /mnt
# losetup -d /dev/loop0
If the partition really holds a normal filesystem, you can also
let mount
set up the loop device, and manage it
automatically:# mount -o loop,offset=$((10860003 * 512)) disk.img /mnt
[...]
# umount /mnt
And since there’s aparently no means to automate the whole
process for an entire disk, I hacked up plosetup.
Enjoy:# plosetup lapse.hda .
I: partition 1 of lapse.hda will become ./lapse.hda_p1 (/dev/loop0)...
I: plosetup: skipping partition 2 of type 82...
I: plosetup: skipping partition 3 of type 5...
I: partition 5 of lapse.hda will become ./lapse.hda_p5 (/dev/loop1)...
I: partition 6 of lapse.hda will become ./lapse.hda_p6 (/dev/loop2)...
I: partition 7 of lapse.hda will become ./lapse.hda_p7 (/dev/loop3)...
I: partition 8 of lapse.hda will become ./lapse.hda_p8 (/dev/loop4)...
I: partition 9 of lapse.hda will become ./lapse.hda_p9 (/dev/loop5)...
# ls -l
total 0
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p1 -> /dev/loop0
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p5 -> /dev/loop1
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p6 -> /dev/loop2
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p7 -> /dev/loop3
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p8 -> /dev/loop4
lrwxrwxrwx 1 root root 10 2006-10-20 13:25 lapse.hda_p9 -> /dev/loop5
# plosetup -c .
# ls -l
total 0
Kpartx:
Kpartx can be used to set up device mappings for the partitions of any
partitioned block device. It is part of the Linux multipath-tools. With
kpartx -l imagefile
you get an overview of the partitions in the image
file and with kpartx -a imagefile
the partitions will accessible
via /dev/mapper/loop0pX
(X is the number of the partition).
You can mount it now with mount /dev/mapper/loop0pX /mnt/ -o loop,ro
.
After unmounting you can disconnect the mapper devices with kpartx -d
imagefile
.
/* The following sample illustrates the use of brackets and the caret (^) with sscanf(). Compile options needed: none */ #include <math.h> #include <stdio.h> #include <stdlib.h> char *tokenstring = "first,25.5,second,15"; int result, i; double fp; char o[10], f[10], s[10], t[10]; void main() { result = sscanf(tokenstring, "%[^','],%[^','],%[^','],%s", o, s, t, f); fp = atof(s); i = atoi(f); printf("%s\n %lf\n %s\n %d\n", o, fp, t, i); }
sudo aptitude install tightvncserver
.~/.vnc/xstartup
. Here is my copy of xstartup: it runs an icewm session, Azureus, and K3B. For Gnome, try running "gnome-session", and for KDE, try "startkde".#!/bin/sh
xrdb $HOME/.Xresources/etc/init.d/vncserver
. The easiest way to do it is to copy it to your clipboard, run sudo -i && cat > /etc/init.d/vncserve && exit
in a terminal, paste it in, and type CTRL-D
. Be sure to change the USER
variable to whatever user you want the VNC server to run under.#!/bin/sh -e
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: networking
# Default-Start: 3 4 5
# Default-Stop: 0 6
### END INIT INFO
PATH="$PATH:/usr/X11R6/bin/"sudo chmod +x /etc/init.d/vncserver
.sudo update-rc.d vncserver defaults
. This adds the appropriate symlinks to the vncserver script so that it is sent the start and stop commands at the appropriate time. Update: jpb writes that you may need to use sudo update-rc.d vncserver default 99
instead if the job is running too early in the boot process.sudo /etc/init.d/vncserver start