by Pedro M. S. Oliveira | Nov 29, 2010 | Linux
Hello people,
If you need to replace a text block on a file you may use awk with the following sintax:
awk ‘/start/{f=1;print;while (getline < “replace.txt”){print}}/end/{f=0}!f’ datafile.txt
where datafile.txt:
bla bla bla
<start>
ble ble ble
ble ble ble
<end>
blo blo
and replace.txt like:
TEST OK
the outcome should be:
bla bla bla
<start>
TEST OK
<end>
blo blo
Cheers,
Pedro Oliveira
by Pedro M. S. Oliveira | Jun 28, 2010 | Linux
Hi!
After a long time without posting on the blog here I come again with a tiny command line that can speed up the usual method of copying large amounts of data.
Sometime ago a college gave me a DVD that I would like to keep to myself but that other 2 colleges wanted too. I used dd, cat and ssh for the task. Taking less that 5 minutes to do it all.
First I started the .iso creation with dd:
dd if=/dev/cdrom of=/home/pedro/my_new_iso.iso
In other console you may start the copy of the iso file even if the iso it’s fully copied to the hard drive (just give a few seconds to have some data copied to the drive):
(cat /home/pedro/my_new_iso.iso | ssh user@remote.host.local dd of=~/my_new_iso.iso) ; (cat /home/pedro/my_new_iso.iso | ssh user2@remote2.host.local dd of=~/my_new_iso.iso)
The only thing you need to guarantee is that the first command ends before the second one.
Cheers,
See you all next time
by Pedro M. S. Oliveira | Sep 14, 2009 | RC Buggies
Last time I wrote about the Hobao Hyper 9ย I was waiting the 9.5 arrival. It did arrived and I managed to put a gallon on it on practice plus a weekend competition. The competition didn’t go that well but it wasn’t the cars fault, just did practice and qualifications having to leave afterwards.
But lets go to what matters, how’s the Hyper 9.5 GL behaving and what are the new features?
Hyper 9.5 GL has some big improvements on its predecessor the Hyper 9 here’s a list:
- 4mm thick + 4mm longer rear lightweight chassis
- CNC Front chassis brace
- CNC Rear chassis brace
- Spider diff (front 5000, center 3000, rear 1000)
- 20 Degree engine mount
- CNC Coordinator mount
- 17mm (20mm) Big Bore shock set
- White spring set
- CNC one piece shock top cap set
- Fiber brake disc set up
- Front +2mm wheel hubs
- Rear +4mm wheel hubs
- Rear 3mm stabilizer
- Dust proof wheel nuts
- Proline 9024 tires
In my opinion on this list of upgrades from the hyper 9 to the 9.5 the really important ones are:
- 4mm thick + 4mm longer rear lightweight chassis
- CNC Front chassis brace
- CNC Rear chassis brace
- 17mm (20mm) Big Bore shock set
- White spring set
- Dust proof wheel nuts
With the new chassis and braces I’ve been damaging lot less parts than I had with the Hyper 9, specially the center dogbones and plastics, the new shocks are also great in handling as the new springs. The dust proof wheel nuts aren’t just a fancy upgrade they do help a lot preventing dust inside the nuts making it faster to replace or upgrade parts on the track.
About all the other improvements they work really well the brakes are much better, tiny springs where added to the brake pads this makes the brake free as soon as you hit the accelerator. The differential as better too, although I didn’t complain on the previous ones.
What I didn’t enjoy that much and reverted to the setting of the hyper 9 was the engine mount, I like the 25 degrees engine mount better, in my opinion the car handles better, but maybe it’s just me that I’m used to the older mount.
About the handling, what can I say, I loved the car before can’t deny it, but now I love it even more (my wife will kill me for saying this) but the handling in curve is better with the new chassis, the life cycle of parts is improved, I ran the gallon and the track weekend with almost no maintaince other than changing shock springs for tunning, and some minor setups (specially on the brakes). I’ve also noticed that with the with the white springs I can go faster on the corners without rolling. I also enjoy the gray ones for tracks that doesn’t have that many jumps.
What more can I say about the car, not much, just a little comparison I’ve been driving an HotBodies D8 and a Kyosho MP9 and compared to the D8 I like the Hyper 9 much more but compared to the Kyosho… well the Kyosho is a really nice car too, it’s fast and small like the Hyper, they both fly well and turn well in the long run I think the Hyper may have some advantage in what matters to shocks and turning speed, in accelaration they both perform very well but i think with the kyosho you can accelerate a bit sooner existing the corners, but this is just a thought, didn’t do an extensive test.
I’m more experienced with the hyper and it shows on lap times, but with the Kyosho I’m a second and a half slower, maybe due to the lack of habit driving it, with the D8 well… I’m three and a half seconds slower…and I’m equally used to it as I am with the Kyosho MP9.
In conclusion I think the Hyper 9.5 GL a great evolution on the hyper, it’s not that cheap nor it’s a car free of trouble, but is one of the best RC cars out there at least that I’ve drove, on the bottom end I really dislike the access to electronics as you have to take out the break linkage to change battery or do something else in the box, but well perfection doesn’t exist ๐
Cheers,
Pedro Oliveira
by Pedro M. S. Oliveira | Aug 24, 2009 | Linux
Hi!
Today I’m writing about a little tool that is an enormous impact onย how to make a remote filesystem available to you as a local filesystem. You may be wondering, what’s the new? NFS does it, Samba does it, it’s true but if you don’t have a VPN and your away from your LAN or WAN a simple task like acceding a folder on a remote web server can be a pain.
The requirements on the host you need to access are:
- SSH server running
- User account
On the client side you’ll need:
- FUSE (Filesystem on user space) – you may install it easily with YUM, Zipper,apt-get, or whatever manager you’r using.
- sshfs – once again you can use your software manager or download it from http://fuse.sourceforge.net/sshfs.html
- On depending on the local mount point you may need root access.
Now before you start lets create a dir so you can have a local mount point:
mkdir $HOME/REMOTE
and the mount command:
sshfs your_user@remote_host.com:/home/youruser $HOME/REMOTE
to umount REMOTE:
fusermount -u REMOTE
And your done .
There are a lot of options to sshfs, write/read under others permissions, sync or async writes, buffers sizes and read ahead options if you want to know more about all the options (and they are a few dozens) just type:
sshfs -h
Cheers and see you next time
Pedro Oliveira
by Pedro M. S. Oliveira | Jul 9, 2009 | Linux, Solaris
That was the question posed on linkedin:
Rsync or Bacula?
A short answer and a middle point:
BackupPC
It can use rsync with all its functionalities, you get a web interface for management,compression, pooling, multiple schedules, differential/incremental/full backups, win a lot of disk space and a security interface.
I use it for my home servers as well for my companies one (managing more or less 50 servers (windows/Linux) and it works like a charm.
The Best of it… it’s open source and have a lot of community support for it.
Cheers,
Pedro M. S. Oliveira
Ps – if you can run it over solaris with ZFS… even better ๐