Wednesday, April 27, 2016
Tuesday, April 26, 2016
Holy Island: A DCI Ryan Mystery by LJ Ross
This book was a best seller when it was released in 2015. It is a detective novel, with pagan cult highlights. Not too deep, but a good and easy read nevertheless.
Thursday, April 21, 2016
Using bus pirate to communicate with chips
Check this post http://hackaday.com/2008/11/19/how-to-the-bus-pirate-universal-serial-interface/
The bus pirate can be connected to a Linux box using a terminal emulator or multiplexer (screen and tmux should work fine)
It can also be used as a logic analyser using an opensource java based tool
https://www.lxtreme.nl/ols/
Another article with usage instruction https://learn.sparkfun.com/tutorials/bus-pirate-v36a-hookup-guide
Wednesday, April 20, 2016
Dynamic dns update with new server
I will include the content of the article here for archival purposes:
In a previous post quite sometime back we explained how to configure a DynDNS service on your Raspberry pi or any similar unix system. This is no different, except for the super easy way of doing the similar thing.
Here we would be using the free DynDNS service of dns4e.com
Step. 1
Goto to https://dns4e.com/registration and sign up
Step. 2
Verify the registered email to activate the service
Step. 3
Add a zone in your account (e.g.: techjawab.dns4e.net)
You can add your own host (which you might have bought separately), in that case you will also need to update the name-servers after this step.
Step. 4
Setup a cron job to update your dynamic ip to dns4e
sudo crontab -e
In the editor add the following line on a new line to update your DNS every 10 minutes
*/10 * * * * curl 'https://api.dns4e.com/v7/<zone address
That's all, you should be able to reach out to your hosted server via the zone address you just configured after the DNS propagates.
Note: If your raspberry pi or unix box is behind a router or firewall then you might have to do port forwarding accordingly to enable the outside world to reach your server.
Tuesday, April 19, 2016
High current usb charging devices
It seems that in order for some devices to detect a charger as high current, the data pins need to be short circuited. This will not work with Apple devices so a data voltage mapping need to be done in that case.
Thursday, April 14, 2016
Dirk Pitt 6, A night probe
As the series progress, they get better. This one is a spy storie. Multiple storylines, and a few unbelievable twists, but enjoyable.
Monday, April 11, 2016
Λεονάρντο ντα βιντσι δια την ζωγραφιά
Νομίζω ότι αυτό είναι ένα από τα πιο ενδιαφέροντα βιβλία που έχω δει τον τελευταίο καιρό : http://www.presspublica.gr/παναγιώτης-ιωάννου-διά-την-ζωγραφ/
Resizing disks in vms
I am going to copy and paste the content, just in case it disappears in the future.
VirtualBox : Extend Virtual Disk and File System
- Extend Virtual Disk
- Create Virtual Disk
- Partition the New Space
- Add Partition to LVM
- Resize Fixed Size Disks
Extend Virtual Disk
VBoxManage modifyhd
command. The approach is similar on Linux and Windows. The --resize
option assumes a size is specified in megabytes. If you want to specify the size in bytes, use the --resizebytes
option.$ cd /u01/VirtualBox/ol6-112/ $ VBoxManage modifyhd ol6-112.vdi --resize 40960 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% $ C:\>cd "C:\Users\myuser\VirtualBox VMs\ol6-112" C:\Users\myuser\VirtualBox VMs>"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd ol6-112.vdi --resize 40960 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% C:\Users\myuser\VirtualBox VMs>
$ VBoxManage modifyhd ./ol6-112.vdi --resize 40960 VBoxManage: error: Cannot register the hard disk '/u01/VirtualBox/ol6-112/ol6-112.vdi' {fc63137b-c779-41a2-b0a3-5fb5788e77cc} because a hard disk '/u01/VirtualBox/ol6-112/ol6-112.vdi' with UUID {fc63137b-c779-41a2-b0a3-5fb5788e77cc} already exists VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp $ $ VBoxManage modifyhd fc63137b-c779-41a2-b0a3-5fb5788e77cc --resize 40960 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% $
Create Virtual Disk
$ cd /u01/VirtualBox/ol6-112/ $ VBoxManage createhd --filename ol6-112b.vdi --resize --size 10240 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Disk image created. UUID: 34d7532e-cd4c-4bf8-88e3-5207aca1e343 $ VBoxManage storageattach ol6-112 --storagectl "SATA" --port 1 --device 0 \ --type hdd --medium ol6-112b.vdi --mtype normal $ C:\>cd "C:\Users\myuser\VirtualBox VMs\ol6-112" C:\Users\myuser\VirtualBox VMs>"C:\Program Files\Oracle\VirtualBox\VBoxManage" createhd ^ --filename ol6-112b.vdi --size 10240 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Disk image created. UUID: 532fa35b-a437-4a07-8f4a-5503e9049cb6 C:\Users\myuser\VirtualBox VMs>"C:\Program Files\Oracle\VirtualBox\VBoxManage" storageattach ol6-112 ^ --storagectl "SATA" --port 1 --device 0 ^ --type hdd --medium ol6-112b.vdi --mtype normal C:\Users\myuser\VirtualBox VMs>
# ls /sys/class/scsi_host/ host0 host1 host2 # # echo "- - -" > /sys/class/scsi_host/host0/scan # echo "- - -" > /sys/class/scsi_host/host1/scan # echo "- - -" > /sys/class/scsi_host/host2/scan
# ls /sys/class/scsi_device 1:0:0:0 2:0:0:0 # # echo 1 > /sys/class/scsi_device/1:0:0:0/device/rescan # echo 1 > /sys/class/scsi_device/2:0:0:0/device/rescan
Partition the New Space
# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_ol6112-lv_root 26G 19G 5.3G 78% / tmpfs 1004M 88K 1004M 1% /dev/shm /dev/sda1 485M 144M 316M 32% /boot //192.168.0.4/u02 907G 746G 115G 87% /host #
# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): p Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00076f69 Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 3917 30944256 8e Linux LVM Command (m for help):
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 3 First cylinder (3917-5221, default 3917): Using default value 3917 Last cylinder, +cylinders or +size{K,M,G} (3917-5221, default 5221): Using default value 5221 Command (m for help):
Command (m for help): t Partition number (1-4): 3 Hex code (type L to list codes): 8e Changed system type of partition 3 to 8e (Linux LVM) Command (m for help):
Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. #
Add Partition to LVM
pvcreate
command.# pvcreate /dev/sda3 Physical volume "/dev/sda3" successfully created #
vgdisplay
command, then use the volume group name and partition name with thevgextend
command.# vgdisplay --- Volume group --- VG Name vg_ol6112 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 29.51 GiB PE Size 4.00 MiB Total PE 7554 Alloc PE / Size 7554 / 29.51 GiB Free PE / Size 0 / 0 VG UUID M3LcFJ-etHj-u7zh-I4em-4Js0-SczK-8JDj93 # vgextend vg_ol6112 /dev/sda3 Volume group "vg_ol6112" successfully extended #
lvdisplay
command to get the root logical volume name. Use the vgdisplay
command to get the free space in the volume group. Use this information in the lvextend
command to extend the logical volume.# lvdisplay | grep "LV Path" LV Path /dev/vg_ol6112/lv_root LV Path /dev/vg_ol6112/lv_swap # vgdisplay vg_ol6112 | grep Free Free PE / Size 2558 / 9.99 GiB # lvextend --size +9.99G --resizefs /dev/vg_ol6112/lv_root Rounding size to boundary between physical extents: 9.99 GiB Extending logical volume lv_root to 35.56 GiB Logical volume lv_root successfully resized resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/mapper/vg_ol6112-lv_root is mounted on /; on-line resizing required old desc_blocks = 2, new_desc_blocks = 3 Performing an on-line resize of /dev/mapper/vg_ol6112-lv_root to 9322496 (4k) blocks. The filesystem on /dev/mapper/vg_ol6112-lv_root is now 9322496 blocks long. #
# lvextend --extents +2559 --resizefs /dev/vg_ol6112/lv_root
lvextend
command used the --resizefs
option. If we had not used this, we would have to run the resize2fs
command separately.# resize2fs /dev/vg_ol6112/lv_root
# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_ol6112-lv_root 36G 19G 15G 56% / tmpfs 1004M 88K 1004M 1% /dev/shm /dev/sda1 485M 144M 316M 32% /boot //192.168.0.4/u02 907G 746G 115G 87% /host #
Resize Fixed Size Disks
VBoxManage modifyhd
command doesn't work on fixed disks, so to get around this, simply clone the existing disk to a dynamically allocated disk, then resize that.$ VBoxManage clonehd ol6-112.vdi ol6-112-b.vdi --format VDI --variant Standard $ VBoxManage modifyhd ol6-112-b.vdi --resize 40960
Friday, April 8, 2016
Dirk Pitt 5: Vixen 03
This book is better than the others, it has multiple storylines, and even though the end is predictable, the plot is actually not.
Sunday, April 3, 2016
Numa 4 white death
Another adventure book with Austin Kurt investigating a company of fish farming. Quite light and enjoyable.