Thursday, November 21, 2013

Safe Delete(Shred) DATA in HDD/ Partition in LINUX


What Happens when you issue remove command on File System?

     Most File System just remove the vnode link from the DIR structure. So what happens to your DATA. You got is right, it just sits at the DISK, waiting for be overwritten or to be recovered by a Crash Recovery Software. The latter sounds good when you are actually using it, but if some one else uses it. You know the consequences. 

How to Safe Delete/ Shred File?

Simple, use any of the above commands

sudo dd if=/dev/zero of=<Device Target>

eg 
sudo dd if=/dev/zero of=/dev/sda

To get the Device Target use the following command

fdisk -l

This command lists all the Disk Partition info with Disk targets.

You can also use this command, if you need to be so sure. This makes two passes in shredding. 

sudo shred -vfz -n 1 <Device Target>

eg
sudo shred -vfz -n 1 /dev/sda

You can also use the LiveBoot of gparted.iso(http://gparted.org/). Boot it via CD/USB. And issue the above command even in Windows/ NON-Linux x86 Machines.

Note : Be careful when playing with these commands. You may purge away useful data Partition/Disk.


Sunday, September 29, 2013

Our Terrace Garden



After much hard work and finally had my first harvest today..


Flowering Plants

Rose




Tomato
 Beans
 Palak
 Palak and Spinach


Thursday, August 22, 2013

POC : Germination on PVC PIPE (Terrace Garden)

Here are the pics. Plants gown here are as follows.
1. Siru Keerai(Tamil) aka Tropical Amaranthus(Botanical)
2. Arai Keerai(Tamil) aka Amaranthus dubius(Botanical)

Added coco peat to get healthier seed germination.




More info to make the PVC structure @
http://ddeepakraja.blogspot.in/2013/05/diy-terrace-garden-from-pvc-pipe.html

Tuesday, July 16, 2013

DIY: Make PCB circuit board at HOME (TONER TRANSFER METHOD)


Bill of Materials
  • Ferrous Chloride (PCB Etching solution)
  • PCB Board
  • Express PCB on PC.  http://www.expresspcb.com/
  • Laser Printer or ( INKJET Printer and Photocopier which uses LASER printers ink)
  • Ordinary Paper
  • Permanent Marker PEN
  • Hot Iron box
  • Kitchen Dish wash bar (VIM dish cleaning bar)
  • Scrub Pad
  • Tissue Paper
  • Paint Thinner Solution
  • 0.1''(inch) drill bit and 0.08"(inch) drill bit
  • Hand Held Driller/ Motorized Driller.
Caution : You are gonna play with Industry Grade Corrosive Solutions. Wear Eye Glasses and protecting gloves before working on this.

1. DESIGN OF PCB CIRCUIT
You need Express PCB software at http://www.expresspcb.com/
PCB components
Pad - The portion of the conductive pattern on printed circuits designated for the mounting or attachment of components. Also called land.
Traces - Literal wire for connecting pads and nodes.
A width of 0.010" is a good default for digital and analog signals.  For power lines, use traces 0.05" or wider.
LAYERS of PCB board
Red -- Top copper layer selection
Green -- Bottom copper layer selection
Yellow - Top silk layer

Start designing the circuit and finalize the design.

2. PRINT OUT the circuit (Toner Transfer Method)
Issue a print out on the Laser Printer. Make sure to make darkened printout. This can be done by changing the printer darken properties. If you happen to have Inkjet printer make sure to print the circuit and obtain a photocopy on photocopier with LASER printer INK. Make sure to darken the copy Image too.

Note: You may/may not need to mirror the circuit image before printing out the circuit on the paper. This step may be need as per your design of the circuit. 

Note: Laser Printer Uses TONER INK. Any printing device using TONER INK is sufficient.

My Printout of the circuit. If you have multi layered  PCB(usually 2 layered). Make sure to take one printout for each layer. I went with single layered PCB only.


3. PCB Cleaning
Wash the PCB Kitchen Dish wash bar (VIM dish cleaning bar or any alternate). Make sure to use the scrubber pad and remove all the oily residue attached on the top of the PCB. Wash with water. Wipe it with dry Tissue. Don't ever touch the Copper side. Your touch places oil back on the PCB.

4. IRON Out the Circuit to the PCB
Make sure to place the circuit print on the copper side and fold out the rest of the paper around the PCB. Use of Sticking tape is not encouraged, as Tape tends to melt out when heat is applied. Apply the Hot IRON on the Paper. Make sure to apply heat uniformly across all the sections of the circuit. Keep the heat and press on the paper for minimum of 10 minutes.

Caution : You are playing with HOT IRON. You may get burns if not used properly. Entire PCB board with the Paper on top will be so hot to hold.





5. CIRCUIT on PCB
After hot iron, give some time to cool out. You will now notice that the CIRCUIT INK melted and stuck to the PCB board. Immerse, the PCB into water and start peeling of the paper. You get the Circuit on the PCB.




6. CORRECTION on PCB circuitry (if any)
You can use the Permanent Board marker to sketch up the left over circuit traces.



7. FERROUS CHLORIDE (the Magic Solution)
Make sure to read the instructions on the solution pack. Usually this chemical comes as a power form. You need to make sure to follow the instructions given in the pack to make the liquid form(Mix with water). Ferrous chloride eats away any exposed metals which comes in contact. Even its vapor is corrosive. Tie the PCB to a Plastic wire and lower it into Ferrous Chloride, which is contained inside a Plastic box. Ferrous Cloride can't attack Plastic. Never touch the solution on bare hands. If happened to touch it accidentally, wash it thoroughly on soap and running water.

Caution : You are gonna play with Industry Grade Corrosive Solutions. Wear Eye Glasses and protecting gloves before working on this.




Make sure to shake the container often, so that the solution is spread out evenly. Generally, it takes less than 20 minutes to etch the metal fully. You have to take out the PCB with the tied wire to check this.

8. PCB Cleaning
Once all the exposed metal are etched away. Dip the PCB in water. Use Kitchen disk wash bar and Scrubber pad to clean the TONER INK. You can also try Thinner solution on the PCB to remove TONNER INK.


10 . FINAL PRODUCT


Note : You have to use the Driller to punch hole for the components mount pads. 


Thursday, May 30, 2013

X11 Forwarding in UBUNTU/ debian

Most Linux Servers are hosted under datacenters. Console SSH access are too dull in aiding USER INTERACTION. GUI can be accessed via SSH + X11 Forwarding. Below are the steps to achieve the same.

1. Download Xming Server for Windows @ http://sourceforge.net/projects/xming/
2. Install Xming Server. Launch Xlaunch and Select MultiWindow option and Display port as 0
3. Launch Putty. Make sure to close all the older putty sessions and relaunch it. Under SSH section -> X11 forwarding Enable it. Display Location as localhost:0
4. Save the session after specifying ServerIP and other details.
5. Login into the Server via SSH from PUTTY.
6. Check if the DISPLAY is set. Don't care about the value for the $DISPLAY variable.
$ echo $DISPLAY
localhost:10.0
7. Install X11 packages under UBUNTU/debian.
$sudo apt-get install xorg
7. Test it. Now you should see a clock window in you windows box. 
$ xclock



Monday, May 20, 2013

COMPUTER AIRFLOW/ CHASSIS FAN DESIGNING DEMYSTIFIED

Had setup a server at home. Did some research on the AIRFLOW in and out of the CHASSIS.

TIPS 
  1. BIGGER FAN(120MM with 1200RPM) controls temperature better.
  2. BETTER CABINET from GOOD Vendor gives added advantage. You may get inbuilt FAN with CHASSIS.
  3. LOOK for LAWS/RULES governing HEAT transfer. Click here for Rules : http://www.techpowerup.com/forums/showthread.php?t=42853
  4. BETTER to control the FAN/ POWER connection via MOTHERBOARD. Best to AVOID straight connection to FAN from SMPS. Straight connection makes the FAN NOISY and reduces the LIFE OF FAN.
  5. FIND the direction of AIR FLOW at the CPU FAN(4pin) which is controlled by Motherboard.
  6. FIND the direction of AIR FLOW at the GPU/VGA/Graphics Card at PCI/PCIe/PCI2.0 slots. This card may contain INBUILT FAN. IF so check the AIR FLOW direction.

Finding AIR FLOW DIRECTION http://www.youtube.com/watch?v=wlgfAO2Jtls
Also to find AIR FLOW direction, place a piece of paper near the FAN. If it sucks in then AIR IN and expels then AIR OUT.

Does 3PIN FAN connector fits into 4 PIN MOTHERBOARD??? YES. Make sure to connect the GND to BLACK WIRE FROM FAN. 4th PIN is for PMW(Pulse Width Modulation), which is used to control RPM on the FLY from UEFI BIOS/ SOFTWARE from OS. JUST 3 PIN FAN also works by leaving PWM PIN. More Info : http://hardforum.com/showthread.php?t=1692017

MY CHASSIS AIRFLOW DESIGN (Best I can GET FROM TRIAL and ERROR Method)


AIR IN - ONE FRONT BOTTOM, TWO SIDE PANEL
AIR OUT - REAR TOP, SMPS TOP FAN
CPU FAN - SUCKS AIR INTO HEAT SINK

MY COMPUTER CHASIS AIR FLOW

UEFI BIOS REPORTS TEMPERATURE AND FAN SPEED

CONCLUSION : ONLY THIS SETUP GAVE BEST RESULTS (ie TEMPERATURE DIFFERENCE OF Approx 5 deg centigrade lesser if compared with OTHER SETUPs).


DIY : Computer Server CHASSIS Table / Multipurpose Table

Had happened to build a multipurpose table to host my computer CHASSIS and Printer. Started working on and built one. Added space for hosting two rows to hold more ITEMS.

BILL OF MATERIALS AND DESIGN
PLYWOOD, REEPER

 PLYWOOD horizontal TOP ROW upside down
 PLYWOOD horizontal TOP ROW upside down with SMALL 3* REEPER nailed.
Marking for the L shaped metal grippers on both horizontal (TOP and BOTTOM) Plywood.


 L shaped metal grippers screwed on to both VERTICAL (LEFT and RIGHT) Plywood.
Center cut at the BOTTOM HORIZONTAL PLYWOOD


SCREW IT UP FRONT VIEW
 UPSIDE DOWN VIEW
Additional Stability by NAILING


Adding a BIG REEPER in the MIDDLE of the FRAME(ADDS RIGIDITY/ STABILITY). BACK VIEW
 FULLY LOADED. TESTED with 2 MEN occupying TOP row. 

Adding Repository(Software source) in UBUNTU / DEBIAN LINUX


# cat /etc/*release* | grep DISTRIB_CODENAME
DISTRIB_CODENAME=raring

Back up the Old Repolist file
# cp /etc/apt/sources.list /etc/apt/sources.list.backup

Repository List file /etc/apt/sources.list .Here is the format to read the content of this file

deb: These repositories contain binaries or precompiled packages. These repositories are required for most users.
deb-src: These repositories contain the source code of the packages. Useful for developers.
http://us.archive.ubuntu.com/ubuntu: The URI (Uniform Resource Identifier), in this case a location on the internet/ or a local server URL.
raring: is the release name or version of your distribution.
main , restricted & multiverse : are the section names or components. There can be several section names, separated by spaces.

New Entry is
deb http://us.archive.ubuntu.com/ubuntu raring main restricted multiverse

Just visit this uri in Webrowser http://us.archive.ubuntu.com/ubuntu to see the multiple folder inside ,which are the components.

Refresh the package list and install softwares.
# apt-get update
# apt-get install gedit

STATIC IP CONFIGURATION IN UBUNTU / LINUX


# cat /etc/network/interfaces
-----------------------interface file--------------------------------
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.X.X.X
netmask 255.Y.Y.Y
broadcast 192.X.X.X
gateway 192.X.X.X
dns-nameservers 192.X.X.X

-----------------------interface file ends-----------------------------

# ifconfig eth0 down
# ifdown eth0
# service networking restart

# ifconfig eth0

route info
# route -n

dns-servers placeholder under /etc/network/interfaces updates <resolve.conf> info too.

# cat /etc/resolv.conf
nameserver 192.X.X.X




CPU Frequency Governors / Power Schemes in LINUX


This feature is available since 3.4 Kernel.
To see the current speed.
watch grep \"cpu MHz\" /proc/cpuinfo
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

CPU POWER SCHEMES

Performance   - Full throttle CLOCK
Powersave     - Run the cpu at the minimum frequency
Userspace     - User Specified CLOCK
Ondemand      - Dynamically switch between CPU(s) available if at 95% cpu load
Conservative  - Dynamically switch between CPU(s) available if at 75% load

More Info
https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt
https://wiki.archlinux.org/index.php/CPU_Frequency_Scaling

To See current power scheme, below is the command. To modify the current scheme just write the new scheme name to the each CPU scale_governor files.

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand
# cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
ondemand

INSTALLING UBUNTU 13.04 64bit OS under UEFI (GUID Partition Table)


UEFI BIOS Setting 

Fast Boot : DISABLED
Secure Boot : DISABLED/OTHER OS TYPE
CSM(Compatibility Support Module)
Boot Device Control : UEFI and LEGACY, UEFI First
Boot From Storage Device : UEFI and LEGACY, UEFI First

GTP Partitioning of the DISK

UEFI Mandates this GTP partition table. GPARTED tool makes this partition happen.
http://gparted.org
http://en.wikipedia.org/wiki/GUID_Partition_Table
Download ISO burn to CD/USB. Boot up and setup the Partition below vi GPARTED Application.
Before doing the partition, you have to format the disk with GTP partition table via GPARTED.

400MB System Partition FAT32 as per the UEFI and GUID Partition Table Specifications. This has to be in the start of the disk. Make sure to set the BOOTABLE flag = true
250GB NTFS
30GB  EXT4 for Linux root
4GB   LINUX-SWAP  
Apply/Commit all the changes to the disk.


BOOTING IN UEFI Mode

Most Important : Make sure to Boot the UBUNTU 13.04 CD in UEFI CD Boot mode. There shall be plain boot mode for the same CD. Careful in your selection.

More Info @ https://help.ubuntu.com/community/UEFI


Now boot up the UBUNTU 13.04 CD in UEFI mode.

400MB System partition has to be mapped to EFI PARTITION as File system during the UBUNTU installation. Rest of the Partition have be mapped for UBUNTU installation(ie root and swap).

After the installation and reboot,you shall see this layout below. GRUB2 is installed under EFI PARTITION which is mounted as /boot/efi

# df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        30G  904M   28G   4% /
/dev/sda1       400M  132K  400M   1% /boot/efi

SHOW PARTITION TABLE

# gdisk
GPT fdisk (gdisk) version 0.8.5
Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 3907029168 sectors, 1.8 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 7FE7EE77-D71C-48B5-B2EF-BEDA1B4C4C7E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 3907029134
Partitions will be aligned on 2048-sector boundaries
Total free space is 1213466733 sectors (578.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          821247   400.0 MiB   EF00  EFI Partition
   2          821248       525109247   250.0 GiB   0700
   3      2097973248      2160887807   30.0 GiB    0700  Dom0 root
   4      2160887808      2169276415   4.0 GiB     8200

Command (? for help): i
Partition number (1-4): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 97D85749-AEAF-4767-95D0-1AAA2905FA3C
First sector: 2048 (at 1024.0 KiB)
Last sector: 821247 (at 401.0 MiB)
Partition size: 819200 sectors (400.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'EFI Partition'

ALL THE AVAILABLE PARTITION TYPES

Command (? for help): l
0700 Microsoft basic data  0c01 Microsoft reserved    2700 Windows RE
4200 Windows LDM data      4201 Windows LDM metadata  7501 IBM GPFS
7f00 ChromeOS kernel       7f01 ChromeOS root         7f02 ChromeOS reserved
8200 Linux swap            8300 Linux filesystem      8301 Linux reserved
8e00 Linux LVM             a500 FreeBSD disklabel     a501 FreeBSD boot
a502 FreeBSD swap          a503 FreeBSD UFS           a504 FreeBSD ZFS
a505 FreeBSD Vinum/RAID    a580 Midnight BSD data     a581 Midnight BSD boot
a582 Midnight BSD swap     a583 Midnight BSD UFS      a584 Midnight BSD ZFS
a585 Midnight BSD Vinum    a800 Apple UFS             a901 NetBSD swap
a902 NetBSD FFS            a903 NetBSD LFS            a904 NetBSD concatenated
a905 NetBSD encrypted      a906 NetBSD RAID           ab00 Apple boot
af00 Apple HFS/HFS+        af01 Apple RAID            af02 Apple RAID offline
af03 Apple label           af04 AppleTV recovery      af05 Apple Core Storage
be00 Solaris boot          bf00 Solaris root          bf01 Solaris /usr & Mac Z
bf02 Solaris swap          bf03 Solaris backup        bf04 Solaris /var
bf05 Solaris /home         bf06 Solaris alternate se  bf07 Solaris Reserved 1
bf08 Solaris Reserved 2    bf09 Solaris Reserved 3    bf0a Solaris Reserved 4
bf0b Solaris Reserved 5    c001 HP-UX data            c002 HP-UX service
ef00 EFI System            ef01 MBR partition scheme  ef02 BIOS boot partition
fd00 Linux RAID

Friday, May 10, 2013

DIY : Terrace Garden from PVC PIPE

Got this idea and began working on this. Here is how you do it.

DESIGN and BILL OF MATERIALS

What u need?


Cutting the Pipe. Since Hack Saw can reach MAX of 10 inch. We cut the pipe in batches.



Spare a few inches in the other end of PIPE. This remaining uncut PIPE keeps the shape sturdy.

Make sure to glue back some piece on the cut end of PIPE. This also keeps the shape sturdy.

Glue both ends of the PIPE with the cover using PVC solvent(glue)



Marking on the plywood

Single Support Structure

All the Support Structures

Final Product

Wait for a DAY for solvent to dry. Testing with water. 

Adding Soil

With Plants

HOW ECONOMICAL????

Cost of PVC 120mm dia PIPE is Rs 30 per feet , 6 * 30 = 180
Cost of Cap Rs 30 per piece                                30*2  = 60
Cost of Plywood                                  Roughly    50      = 50
Cost of Hack saw Blade Rs 10 per piece           1 * 10   = 10
PVC Solvent 100ml                                                       =  40
---------------------------------------------------------------------
Total                                                                             =  Rs. 340
---------------------------------------------------------------------

COMPARISON WITH BAKED CLAY POTS

POTS 5''inch in diameter and 4''inch in height. 
Let us assume we are planting seeds with distance gap of 2 inch from the adjacent one. 






IN PRICE (SAME SPACE occupancy)
Each POTs costs around Rs. 30. To occupy the same size as of PVC structure we need around => 5'10''/5'' =14 pots. This POTs costs around.14 * 30 = Rs. 420
But, PVC Structure cost = Rs. 340

IN SEED ACCOMMODATION 
Each POTs can hold 3 seeds considering 2 inch gap between adjacent ones. So 14 POTS can hold 14 * 3 = 42 SEEDS
PVC structure can hold two rows. Each row can take 70''/2'' = 35 SEEDS. So TOTAL = 70 SEEDS.

This type of PVC structure is easy to maintain. If you are concerned about plantation coverage on large scale, this idea can give you some answer for your problem.