Monthly Archives: July 2012
Electromagnetic Radiation Detector
Features:
- Simple operation, fast measurement of the electrical appliances, wires and industrial equipment around the intensity of electromagnetic radiation.
- Test band width can be divided into high-frequency, low-frequency two steps of measurement.
- Test accuracy, the lowest frequency of measurement of electromagnetic radiation up to 5Hz.
- Value for money, easy to carry.
- Designed to meet CE industrial standard.
- For the environmental electromagnetic radiation testing: bedroom, office, computer room, control room, cable, power lines, monitors, transmitters and other sources of measurement.
- Used in home electrical equipment, measurement of electromagnetic radiation: mobile phone, computers, televisions, copiers, fax machines, air conditioners and other power sources of test analysis.
- Dimension: 13.5cm x 7cm x 3cm.
- Display readings: three semi-liquid crystal display, maximum reading low-frequency 1999V/M / High Frequency 1999μW/cm2.
- Level: low-frequency V/m, high-frequency: -μW/cm2.
- Measurement time intervals: 0.4 seconds.
- Operation voltage: 9V.
- Measure frequency range: low frequency:5Hz-400KHz, high frequency: 30MHz-2000MHz.
- Operation temperaturer: -15°C ~ +60°C.
Sharepoint Foundation 2010 – Powershell cmdlet
PowerShell cmdlet
Get-SPSite
http://technet.microsoft.com/en-us/library/ff607950.aspx
QNAP TS-212 – How to save RAID settings from telnet
Scenario = you have wrongly initialize a new HDD a single disk but you would like to be added as RAID1 disk.
QNap support team suggested to remove all partition and reboot NAS
This should be done connecting the second disk to a computer, delete volume and partition, and connect disk back into the NAS, which is quite boring.
Here is how to delete partition table from telnet:
- Open telnet
- Login as admin
- Check which disk is used as RAID to avoid a “wrong” delete
mdadm –detail /dev/md0Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 3 1 active sync /dev/sda3 - So we need to clean the /dev/sdb partitions
fdisk -l /dev/sdbDisk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/sdb1 1 66 530125 83 Linux
/dev/sdb2 67 132 530142 83 Linux
/dev/sdb3 133 121538 975193693 83 Linux
/dev/sdb4 121539 121600 498012 83 Linux - Dismount the volume before starting the work
umount /dev/sdb3 - So we have 4 partition, type the follow to enter in fdisk mode
fdisk /dev/sdb - If you need help type “m”
- List all partition as above, type “p”
Command (m for help): pDisk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/sdb1 1 66 530125 83 Linux
/dev/sdb2 67 132 530142 83 Linux
/dev/sdb3 133 121538 975193693 83 Linux
/dev/sdb4 121539 121600 498012 83 Linux - Press “p” to delete partitions and the number of partition to delete
Command (m for help): d
Partition number (1-4): 1Command (m for help): d
Partition number (1-4): 2Command (m for help): d
Partition number (1-4): 3Command (m for help): d
Partition number (1-4): 4 - Print all partitions of the disk with “p"
Command (m for help): pDisk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
- Save the changes with “w”
- You need to save RAID settings information in the /etc/config/raidtab file
- The easy way to save RAID configuration is this:
more /etc/config/raidtab
cp /etc/config/raidtab /share/Public - Change raidtab file like this one
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
chunk-size 4
persistent-superblock 1
device /dev/sda3
raid-disk 0
device /dev/sdb3
raid-disk 1 - save and copy back to original location
cp raidtab /etc/config
more /etc/config/raidtab - Change also /etc/storage.conf file
Set it only for RAID volume and clear all reference for single volume[VOLUME 1]
device name = /dev/md0
raid level = 1
raid disks = 1,0
spare raid disks =
status = 0
record_time = Thu Jul 19 22:53:14 2012filesystem = 104
[Global]
Available Disk = 2 - Reboot the NAS & Check if RAID was rebuilt correctly
QNAP TS-212 How to rebuild RAID manually from telnet
Scenario = replace a disk in QNAP TS-212 with RAID 1 configuration active
RAID rebuild should start automatically, but some times it could happen you got stuck with 1 Single Disk + 1 Mirroring Disk Volume:
According to the QNAP Support – How can I migrate from Single Disk to RAID 0/1 in TS-210/TS-212? , TS-210/TS-212 does not support Online RAID Level Migration. Therefore, please backup the data on the single disk to another location, install the second hard drive, and then recreate the new RAID 0/1 array (hard drive must be formatted).
The workaround is this:
- Telnet to NAS as Admin
- Check your current disk configuration for Disk #1 and Disk #2 =
fdisk -l /dev/sda Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/sdb1 1 66 530125 83 Linux
/dev/sdb2 67 132 530142 83 Linux
/dev/sdb3 133 121538 975193693 83 Linux
/dev/sdb4 121539 121600 498012 83 Linuxfdisk -l /dev/sdb
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/sda1 1 66 530125 83 Linux
/dev/sda2 67 132 530142 83 Linux
/dev/sda3 133 121538 975193693 83 Linux
/dev/sda4 121539 121600 498012 83 Linux - SDA is the first disk, SDB is the second disk
- Verify the current status of RAID with this command =
mdadm –detail /dev/md0
/dev/md0:
Version : 00.90.03
Creation Time : Thu Sep 22 21:50:34 2011
Raid Level : raid1
Array Size : 486817600 (464.27 GiB 498.50 GB)
Used Dev Size : 486817600 (464.27 GiB 498.50 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistentIntent Bitmap : Internal
Update Time : Thu Jul 19 01:13:58 2012
State : active, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0UUID : 72cc06ac:570e3bf8:427adef1:e13f1b03
Events : 0.1879365Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 3 1 active sync /dev/sda3 - As you can see the /dev/sda3 is working, so disk #1 is OK, but disk #2 is missing from RAID
- Check if Disk #2 /dev/sdb is mounted (it should be) =
mount/proc on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,size=32M)
none on /proc/bus/usb type usbfs (rw)
/dev/sda4 on /mnt/ext type ext3 (rw)
/dev/md9 on /mnt/HDA_ROOT type ext3 (rw)
/dev/md0 on /share/MD0_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,delalloc,noacl)
tmpfs on /var/syslog_maildir type tmpfs (rw,size=8M)
/dev/sdt1 on /share/external/sdt1 type ufsd (rw,iocharset=utf8,dmask=0000,fmask=0111,force)
tmpfs on /.eaccelerator.tmp type tmpfs (rw,size=32M)
/dev/sdb3 on /share/HDB_DATA type ext3 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,noacl) - Dismount the /dev/sdb3 Disk #2 with this command =
umount /dev/sdb3 - Add Disk #2 into the RAID /dev/md0 =
mdadm /dev/md0 –add /dev/sdb3 mdadm: added /dev/sdb3 - Check the RAID status and the rebuild should be started automatically =
mdadm –detail /dev/md0 /dev/md0:
Version : 00.90.03
Creation Time : Thu Sep 22 21:50:34 2011
Raid Level : raid1
Array Size : 486817600 (464.27 GiB 498.50 GB)
Used Dev Size : 486817600 (464.27 GiB 498.50 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistentIntent Bitmap : Internal
Update Time : Thu Jul 19 01:30:27 2012
State : active, degraded, recovering
Active Devices : 1
Working Devices : 2
Failed Devices : 0
Spare Devices : 1Rebuild Status : 0% complete
UUID : 72cc06ac:570e3bf8:427adef1:e13f1b03
Events : 0.1879848Number Major Minor RaidDevice State
2 8 19 0 spare rebuilding /dev/sdb3
1 8 3 1 active sync /dev/sda3 - Check the NAS site for the rebuild % progress
- After the RAID rebuild complete, restart NAS to clean all previous mount point folder for sdb3
Rise, rise and rise again ’till lambs become lions
Opticon OPN2001 – CSV file data manipulation using PowerShell
CSV file RAW data should be like this =
BarCode Number, Time of Scan, Date of Scan
20120711001, 21:00:00, 2012-07-11
321530, 21:01:01, 2012-07-11
123456, 21:02:02, 2012-07-11
20120711001, 22:00:00, 2012-07-11
123456, 22:01:01, 2012-07-11
321530, 22:02:02, 2012-07-11
After the table modification with the PowerShell script, it should result as follow =
Mission ID, Person ID, Start Time, Start Date, Stop Time, Stop Date
20120711001, 20120711001, 21:00:00, 2012-07-11, 22:00:00, 2012-07-11
20120711001, 321530, 21:01:01, 2012-07-11, 22:01:01, 2012-07-11
20120711001, 123456, 21:02:02, 2012-07-11, 22:02:02, 2012-07-11
The basic PowerShell cmdlet to read and write CSV file are:
Import-Csv c:\scripts\test.txt
Export-Csv c:\scripts\test.txt
Import-Csv c:\scripts\test.txt | Where-Object {$_.department -eq "Finance"}
Get-Content c:\scripts\test.txt
Blog example to manipulate data inside PowerShell:
import-csv test.csv | set-type -type_hash @{id=[int];workingset=[int];cpu=[float]} | ogv
Import-Csv d:\temp\so\csv1.txt -Delimiter ‘;’ | % { $_.col3 = ‘append\’ +$_.col3; $_ } | Export-Csv d:\temp\so\csv2.txt -Delimiter ‘;’
or
Import-Csv -Delim ';' cols.csv | Foreach {$_.col3 = "prepend\$($_.col3)";$_} | Export-Csv cols2.csv -Delim ';' -NoTypeInformation
$SCRIPT:IMP = Import-CSV C:\Tools\PSScripts\ShellAuditSubSet.csv
$IMP | foreach-object { $_.Message
$CleanReturn = (CleanData ($_.Message))
if($Messy -cne "")
{
$_.Message = $CleanReturn
Write-Host "MESSAGE DATA IS " + $_.Message
}
}
Opticon OPN2001 – Flow of bar code reader data output
Firmware, Software and SDK is available on the Opticon website
Barcodes.txt file is created automatically with OPN2001 x64 tool
The format could be personalized with list of fields, best option is as follow:
BarCode Number, Time of Scan, Date of Scan
321530, 21:05:25, 2012-07-11
123456, 21:06:26, 2012-07-11
123456, 21:10:48, 2012-07-11
321530, 21:11:49, 2012-07-11
Need to associate a mission with a UID like YYYYmmDDnnn that should result:
Mission ID, Person ID, Time of Scan, Date of Scan
20120711001, 321530, 21:05:25, 2012-07-11
20120711001, 123456, 21:06:26, 2012-07-11
20120711001, 123456, 21:10:48, 2012-07-11
20120711001, 321530, 21:11:49, 2012-07-11
Procedure should be:
- Generate Mission ID code once confirmed, with format like YYYYmmDDnnn
- Print the bar code to take note of people available
- Once mission start, read first mission ID as marker
- Scan all people ID code at start
- Once mission end, read first mission ID as marker
- Scan all people ID code at end
- Connect to USB cable at headquarter
- Run the Opticon utility to download the data and create CSV file in PC
- Create a custom PowerShell script to modify the RAW data from this format
BarCode Number, Time of Scan, Date of Scan
20120711001, 21:00:00, 2012-07-11
321530, 21:01:01, 2012-07-11
123456, 21:02:02, 2012-07-11
20120711001, 22:00:00, 2012-07-11
123456, 22:01:01, 2012-07-11
321530, 22:02:02, 2012-07-11After the table modification, it should result as follow:
Mission ID, Person ID, Time of Scan, Date of Scan
20120711001, 321530, 21:05:25, 2012-07-11
20120711001, 123456, 21:06:26, 2012-07-11
20120711001, 123456, 21:10:48, 2012-07-11
20120711001, 321530, 21:11:49, 2012-07-11 - Then import CSV file into SharePoint automatically
Create RSS Feed from static HTML webpage
RSS Feed allow you to schedule pre-defined action thanks to www.IFTTT.com
Some old or “formal” website didn’t rely on RSS Feed, causing problem of integration.
The good news is that you can easily create RSS Feed from that “old” website using free online services like Feed43
Most website create them analyzing the source code of the webpage, so you need to dig a little bit, to identify the “range” in the code that will identify your news, to publish in the feed.
- Paste HTML link into the source page, like =
http://www.protezionecivile.regione.lombardia.it/cs/Satellite?c=Redazionale_P&childpagename=DG_ProtezioneCivile%2FDetail&cid=1213279840110&pagename=DG_PPPWrapper - Global Search Pattern =
<h2><a name="1213279842587"></a>Allerte meteo</h2>
{*}
<p>{%}</p> - Item (repeatable) Search Pattern =
{%}
Then you got the HTML text inside the <p>{%}</p> right after the “Allerte meteo” H2 title
The rest of settings in the Feed43 page are used only to create a better RSS with title, link and file name.
My Personal links =
- Allerte Meteo – Regione Lombardia =
http://www.feed43.com/allerte_meteo_reg_lombardia.xml - Rischio Incendi Boschivi – Regione Lombardia =
http://www.feed43.com/rischio_incendi_boschivi_lomb.xml - Emergenze in corso – Regione Lombardia =
http://www.feed43.com/emergenze_regione_lombardia.xml - Comunicati – Regione Lombardia =
http://www.feed43.com/comunicati_regione_lombardia.xml - Protezione Civile – Provincia di Milano =
http://www.feed43.com/protciv_provincia_milano.xml
Standard Model – Higgs boson
We got it! 🙂