Tuesday, July 28, 2015

Increase swap, Raspberry Pi

Raspberry Pi do not have swap partition as usualy linux do.
Raspberry Pi like a windows has swap file which by default has only 100 Mb.

So if you really want to squeeze the juice out of your sd or micro sd card you can increase swap file.

To do it so open configuration:
sudo nano /etc/dphys-swapfile
Set default size 100 to something bigger like 1024:
CONF_SWAPSIZE=1024
2048 is maximum allowed!

Monday, July 27, 2015

Friday, July 24, 2015

Responsive view by hiding right and left panel

This is my blogger basic responsive design.

Config of my layout:

And the width and height:

@media(max-width: 677px) {
.content-outer, .content-fauxcolumn-outer, .region-inner {min-width: 100%; max-width: 100%;}
.main-inner .fauxcolumn-right-outer, .main-inner .column-right-outer {display: none; width: 0px; margin-right: 0px;}
.main-inner .fauxcolumn-left-outer, .main-inner .column-left-outer {display: none; width: 0px; margin-right: -0px;}
.main-inner .columns {padding-left:  0px; padding-right:  0px;}
body {min-width: 100%;}
#column-right-outer {display: none;}
#column-left-outer {display: none;}
}

@media(min-width: 677px) {
.content-outer, .content-fauxcolumn-outer, .region-inner {min-width: 677px; max-width: 677px;}
.main-inner .fauxcolumn-right-outer, .main-inner .column-right-outer {display:  none; width: 16px; margin-right: -16px;}
.main-inner .fauxcolumn-left-outer, .main-inner .column-left-outer {display: none; width: 16px; margin-right: -16px;}
.main-inner .columns {padding-left: 16px; padding-right: 16px;}
body {min-width: 677px;}
#column-right-outer {display: none;}
#column-left-outer {display: none;}
}

@media(min-width: 837px) {
.content-outer, .content-fauxcolumn-outer, .region-inner {min-width: 837px; max-width: 837px;}
.main-inner .fauxcolumn-right-outer, .main-inner .column-right-outer {display: none; width: 16px; margin-right: -16px;}
.main-inner .fauxcolumn-left-outer, .main-inner .column-left-outer {display: block; width: 176px; margin-right: -176px;}
.main-inner .columns {padding-left: 176px; padding-right: 16px;}
body {min-width: 837px;}
#column-right-outer {display: none;}
#column-left-outer {display: block;}
}

@media(min-width: 1137px) {
.content-outer, .content-fauxcolumn-outer, .region-inner {min-width: 1137px; max-width: 1137px;}
.main-inner .fauxcolumn-right-outer, .main-inner .column-right-outer {display: block; width: 316px; margin-right: -316px;}
.main-inner .fauxcolumn-left-outer, .main-inner .column-left-outer {display: block; width: 176px; margin-right: -176px;}
.main-inner .columns {padding-left: 176px; padding-right: 316px;}
body {min-width: 1137px;}
#column-right-outer {display: block;}
#column-left-outer {display: block;}
}

Thursday, July 23, 2015

Extract directory, 7z, command line, wsusscn2.cab

http://download.windowsupdate.com/microsoftupdate/v6/wsusscan/wsusscn2.cab is microsoft windows update catalog of all updates.

This archive contains a bunch of another multiple archives.
The first one package.cab is the most important couse it contains package.xml which contains all information about update classification and supersede information.

There ar no update names and KB.. codes listed in package.xml.

Analyzing package.xml it look like that:
Revision ID is used to manage update supersede stance
Update ID is used to manage update prerequisites

Also the Revision ID is how the updates is indexed in other archives:
package1.cab
package2.cab
...
package32.cab
..
There has update names for all available languages worldwide but it will be nice if we can use only one language.

An the Id's is just integer numbers like:
9248598
9248600
9248612
...
Extract all Id's in en language from archive package32.cab to directory RevisionId:
7z e package32.cab "l\en" -oRevisionId
Extract all Id's in en language from all packages to directory RevisionId:
@echo off
if exist "%~dp0RevisionId" rd "%~dp0RevisionId" /Q /S
for /f "delims=" %%a in ('dir /b "%~dp0*.cab" ^| find /V "package.cab"') do (
echo extracting %%a..
7z e "%~dp0%%a" "l\en" -o"%~dp0RevisionId" > nul 2>&1
)
pause

Wednesday, July 22, 2015

Overwrite default profile to all users, linux

This will list all exiting users from /home and overwrite files from /etc/skel.
Any other existing files stays untouched.

Create script
nano overwrite
Paste content:
#!/bin/sh
array=$(ls -1 /home | sed '$athis is last line')
printf %s "$array" | while IFS= read -r line
do {
echo $line
sudo rsync -rtv /etc/skel/ /home/$line/
} done
Set it executable:
sudo +x overwrite
Run script:
./overwrite
Or use just copy and paste in one line:
array=$(ls -1 /home | sed '$athis is last line'); printf %s "$array" | while IFS= read -r line; do { echo $line; sudo rsync -rtv /etc/skel/ /home/$line/; } done

Tuesday, July 21, 2015

Chromium browser fresh start, Raspberry Pi

sqlite3 must be installed:
sudo apt-get install sqlite3 -y
Set chromium to boot at startup for current user (pi):
nano ~/.config/openbox/autostart
Set chromium to boot at startup for all new users:
sudo mkdir -p /etc/skel/.config/openbox
sudo nano /etc/skel/.config/openbox/autostart
Enter content:
#!/bin/sh
rm -rf ~/.cache/chromium
rm -rf ~/.config/chromium
rm -rf ~/.pki
mkdir -p ~/.config/chromium/Default
sqlite3 ~/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);";
chromium-browser --disable-plugins --kiosk --incognito http://www.catonrug.net/p/raspberry-pi.html
Set it executable for current user:
chmod +x ~/.config/openbox/autostart
Set it executable for future users:
sudo chmod 755 /etc/skel/.config/openbox

Monday, July 20, 2015

Start a program in Openbox startup, Raspberry Pi

To start a program in openbox startup you have to create absolute new file at user profile:
nano ~/.config/openbox/autostart
Set the content like:
#!/bin/sh
chromium --kiosk --incognito www.catonrug.net/p/raspberry-pi.html
Set the file executable:
sudo chmod +x ~/.config/openbox/autostart
If you want to work this solution for all the new users in future you need to create new config file for new user profile:

Create necessary directory structure:
sudo mkdir -p /etc/skel/.config/openbox
Create new file:
sudo nano /etc/skel/.config/openbox/autostart
Set what to do:
#!/bin/sh
chromium --kiosk --incognito www.catonrug.net/p/raspberry-pi.html
Set this file executable for all users:
sudo chmod 755 /etc/skel/.config/openbox/autostart
Now when you create new user the startup script will be automatically added from /etc/skel
pi@raspberrypi ~ $ sudo adduser ben
Adding user `ben' ...
Adding new group `ben' (1014) ...
Adding new user `ben' (1013) with group `ben' ...
Creating home directory `/home/ben' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for ben
Enter the new value, or press ENTER for the default
        Full Name []:
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y

Friday, July 17, 2015

Start web browser in full screen mode, Raspberry Pi

Install Chromium:
sudo apt-get install chromium -y
Start Chromium in full screen mode:
chromium --kiosk --incognito www.catonrug.net/p/raspberry-pi.html
Install Midori:
sudo apt-get install midori -y
Start Midori:
midori -e Fullscreen -a www.catonrug.net/p/raspberry-pi.html
Other browsers without full screen mode:
Install SeaMonkey:
sudo apt-get install iceape-browser -y
Launch Seamonkey:
iceape -browser www.catonrug.net/p/raspberry-pi.html
Install Firefox:
sudo apt-get install iceweasel -y
Launch Firefox:
iceweasel -browser www.catonrug.net/p/raspberry-pi.html
In other browsers you can press F11 to go in full screen mode.
To save these settings in browser you can use ALT+F4 to quit the browser.

Thursday, July 16, 2015

Change Raspbian windows manager to Openbox

To change default windows manager open:
sudo nano /usr/bin/x-session-manager
Replace the last line:
exec /usr/bin/lxsession -s LXDE-pi -e LXDE
with
exec /usr/bin/openbox-session
Alternative you can use one command:
sudo sed -ri "s/exec \/usr\/bin\/lxsession -s LXDE-pi -e LXDE/exec \/usr\/bin\/openbox-session/" /usr/bin/x-session-manager
or change back to original:
sudo sed -ri "s/exec \/usr\/bin\/openbox-session/exec \/usr\/bin\/lxsession -s LXDE-pi -e LXDE/" /usr/bin/x-session-manager

Tuesday, July 14, 2015

Target blogger pages, <b:if cond=''></b:if>

Target post (item) pages:
<b:if cond='data:blog.pageType == "item"'></b:if>
Do not include in item page:
<b:if cond='data:blog.pageType != "item"'></b:if>
Target static pages:
<b:if cond='data:blog.pageType == "static_page"'></b:if>
Do not include in static page:
<b:if cond='data:blog.pageType != "static_page"'></b:if>
Target post and static pages together:
<b:if cond='data:blog.url == data:post.url'></b:if>
Do not include in post and static page:
<b:if cond='data:blog.url != data:post.url'></b:if>
Target archive pages:
<b:if cond='data:blog.pageType == "archive"'></b:if>
Target Homepage:
<b:if cond='data:blog.url == data:blog.homepageUrl'></b:if>
Target specific page/URL:
<b:if cond='data:blog.url == "http://www.catonrug.net/2012/02/windows-10.html"'></b:if>
No not include in url:
<b:if cond='data:blog.url != "http://www.catonrug.net/p/raspberry-pi.html"'></b:if>
Target label-search pages. This happens when you click on label like Meow
<b:if cond='data:blog.searchLabel'></b:if>
Index (list) pages:
<b:if cond='data:blog.pageType == "index"'></b:if>

Monday, July 13, 2015

Extend TorBery filesystem, minimal Raspbian image

Torbery is very, very nice raspberry pi image wich will be your instant anonymous proxy server:

Torberry image:
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/torberry/torberry-0.40.img.xz
0a5ad217e93c95928b395e86406c84fa
4666be1c8150a64c3d50b4a9390b3420e2e1c601

To use it as proxy server just push image to SD card and set the Raspberry Pi IP adreess into another workstations internet browser settings:

If you want to use this box for another purpose you probably need to extend root filesystem. SSH is enable for this box by default. So we log into this system with default username pi and password raspberry and we can launch df command to see how mush space we can still use it:
pi@torberry ~ $ df
Filesystem     1K-blocks   Used Available Use% Mounted on
rootfs            337127 270927     48792  85% /
/dev/root         337127 270927     48792  85% /
devtmpfs          216132      0    216132   0% /dev
tmpfs              44880    188     44692   1% /run
tmpfs               5120      0      5120   0% /run/lock
tmpfs              89740      0     89740   0% /run/shm
/dev/mmcblk0p1     57288  18888     38400  33% /boot
tmpfs              49152      4     49148   1% /var/lib/tor
tmpfs               6144      4      6140   1% /var/log/tor
At first we can disable tor service at startup and stop it right now:
sudo chmod -x /etc/init.d/tor && sudo /etc/init.d/tor stop
To extend root file system launch partition tool and print partition table:
sudo fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 31.7 GB, 31724666880 bytes
4 heads, 16 sectors/track, 968160 cylinders, total 61962240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00065c03

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880      819199      348160   83  Linux
We have to remember the first block of second partition which in this case always be 122880

So we just delete MBR information about second partition existence in your SD card:
Command (m for help): d
Partition number (1-4): 2
Now we create new information about second partition. This time we will set same start block 122880 but this time the last block will be much bigger
Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (2048-61962239, default 2048): 122880
Last sector, +sectors or +size{K,M,G} (122880-61962239, default 61962239):
Using default value 61962239
And at last we write changes with w
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.
All together look like this:

Now wee need reboot the system:
sudo reboot
After reboot nothing is resized untill we run the command:
sudo resize2fs /dev/mmcblk0p2
This will take up to ten seconds and the output will be similar to this:
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 118
The filesystem on /dev/mmcblk0p2 is now 30919680 blocks long.
And now the system is much bigger:
df
Filesystem     1K-blocks   Used Available Use% Mounted on
rootfs          29951137 271448  28439789   1% /
/dev/root       29951137 271448  28439789   1% /
devtmpfs          216132      0    216132   0% /dev
tmpfs              44880    180     44700   1% /run
tmpfs               5120      0      5120   0% /run/lock
tmpfs              89740      0     89740   0% /run/shm
/dev/mmcblk0p1     57288  18888     38400  33% /boot
tmpfs              49152      0     49152   0% /var/lib/tor
tmpfs               6144      0      6144   0% /var/log/tor

Monday, July 6, 2015

Remove offline directory, dism, 0xc1420114

dism /mount-wim /wimfile:c:\install.wim /index:1 /mountdir:c:\offline

Deployment Image Servicing and Management tool
Version: 6.3.9600.17029


Error: 0xc1420114

The user attempted to mount to a directory that is not empty.  This is not supported.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
To solve this case execute
DISM.exe /Unmount-Wim /MountDir:C:\offline /discard

Sunday, July 5, 2015

Add multiple users on linux without prompt

Basic:
# add user and set home directory
sudo useradd -d /home/first first

# create home directory
sudo mkdir /home/first 

# copy default home directroy content
sudo cp /etc/skel/* /home/first

# set owner and owner group to the home directory
sudo chown -R first:first /home/first

# set password raspberry for this user first
echo first:raspberry | sudo /usr/sbin/chpasswd
Create multiple users:
#!/bin/bash
declare -a list=(first second third fourth fifth sixth seventh eighth ninth tenth)
x=0
while [ $x -lt ${#list[@]} ]
do
echo creating user ${list[$x]}

sudo useradd -d /home/${list[$x]} ${list[$x]}
sudo mkdir /home/${list[$x]}
sudo cp /etc/skel/* /home/${list[$x]}
sudo chown -R ${list[$x]}:${list[$x]} /home/${list[$x]}
echo ${list[$x]}:raspberry | sudo /usr/sbin/chpasswd

x=$(( $x + 1 ))
done

autounattend.xml for Windows 7 Ultimate

This autounattend.xml destroy all HDD data without prompting and create one big partition on whole disk. It is tested for X17-59465.iso and X17-59463.iso and works out of the box.

X17-59465.iso
c9f7ecb768acb82daacf5030e14b271e
36ae90defbad9d9539e649b193ae573b77a71c83

X17-59463.iso
2572274e6b0acf4ed1b502b175f2c2db
65fce0f445d9bf7e78e43f17e441e08c63722657

For FirstRun script you have to create file:
%dvdroot%\sources\$OEM$\$$\Setup\Scripts\FirstRun.cmd:
Extension of this file is .cmd

FirstRun.cmd contains:
for %%i in (b c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%i:\FirstRun\FirstRun.bat %%i:\FirstRun\FirstRun.bat
)
After all you have to create new FirstRun directory and FirstRun.bat and place inside all you want like 7-zip install:
Extension of this file is .bat

The autounattend.xml file by itself you have to place on DVD root:

Content of autounattend.xml:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        
 <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
  
 <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <InputLocale>en-US</InputLocale>
            <SystemLocale>en-US</SystemLocale>
            <UILanguage>en-US</UILanguage>
            <UserLocale>en-US</UserLocale>
        </component>
  
        <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DiskConfiguration>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Extend>false</Extend>
                            <Format>NTFS</Format>
                            <Letter>C</Letter>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Label>System</Label>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows 7 ULTIMATE</Value>
                        </MetaData>
                    </InstallFrom>
                </OSImage>
            </ImageInstall>
            <UserData>
                <AcceptEula>true</AcceptEula>
                <FullName></FullName>
                <Organization></Organization>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV</Key>
                </ProductKey>
            </UserData>
        </component>
  
 <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DiskConfiguration>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Type>Primary</Type>
                            <Extend>true</Extend>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Extend>false</Extend>
                            <Format>NTFS</Format>
                            <Letter>C</Letter>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                            <Label>System</Label>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
                <WillShowUI>OnError</WillShowUI>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>1</PartitionID>
                    </InstallTo>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/NAME</Key>
                            <Value>Windows 7 ULTIMATE</Value>
                        </MetaData>
                    </InstallFrom>
                </OSImage>
            </ImageInstall>
            <UserData>
                <AcceptEula>true</AcceptEula>
                <FullName></FullName>
                <Organization></Organization>
                <ProductKey>
                    <WillShowUI>OnError</WillShowUI>
                    <Key>D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV</Key>
                </ProductKey>
            </UserData>
        </component>  
  
    </settings>
 
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RegisteredOrganization></RegisteredOrganization>
            <TimeZone>Pacific Standard Time</TimeZone>
            <RegisteredOwner></RegisteredOwner>
            <AutoLogon>
                <Password>
                    <Value></Value>
                    <PlainText>true</PlainText>
                </Password>
                <Username>administrator</Username>
                <LogonCount>3</LogonCount>
                <Enabled>true</Enabled>
            </AutoLogon>
            <ProductKey>D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV</ProductKey>
            <ComputerName />
        </component>
  
 <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RegisteredOrganization></RegisteredOrganization>
            <TimeZone>Pacific Standard Time</TimeZone>
            <RegisteredOwner></RegisteredOwner>
            <AutoLogon>
                <Password>
                    <Value></Value>
                    <PlainText>true</PlainText>
                </Password>
                <Username>administrator</Username>
                <LogonCount>3</LogonCount>
                <Enabled>true</Enabled>
            </AutoLogon>
            <ProductKey>D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV</ProductKey>
            <ComputerName />
        </component>
  
    </settings>
 
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <ProtectYourPC>1</ProtectYourPC>
                <NetworkLocation>Work</NetworkLocation>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value></Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>administrator</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <AutoLogon>
                <Enabled>true</Enabled>
                <Username>Administrator</Username>
                <LogonCount>3</LogonCount>
            </AutoLogon>
            <RegisteredOrganization></RegisteredOrganization>
            <RegisteredOwner></RegisteredOwner>
   <FirstLogonCommands>
            <SynchronousCommand wcm:action="add">
            <Order>1</Order>
            <Description>Run FirstRun.cmd</Description>
            <CommandLine>%WINDIR%\Setup\Scripts\FirstRun.cmd</CommandLine>
            </SynchronousCommand>
   </FirstLogonCommands>
        </component>
  
 <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <OOBE>
                <ProtectYourPC>1</ProtectYourPC>
                <NetworkLocation>Work</NetworkLocation>
            </OOBE>
            <UserAccounts>
                <LocalAccounts>
                    <LocalAccount wcm:action="add">
                        <Password>
                            <Value></Value>
                            <PlainText>true</PlainText>
                        </Password>
                        <Name>administrator</Name>
                        <Group>Administrators</Group>
                    </LocalAccount>
                </LocalAccounts>
            </UserAccounts>
            <AutoLogon>
                <Enabled>true</Enabled>
                <Username>Administrator</Username>
                <LogonCount>3</LogonCount>
            </AutoLogon>
            <RegisteredOrganization></RegisteredOrganization>
            <RegisteredOwner></RegisteredOwner>
   <FirstLogonCommands>
            <SynchronousCommand wcm:action="add">
            <Order>1</Order>
            <Description>Run FirstRun.cmd</Description>
            <CommandLine>%WINDIR%\Setup\Scripts\FirstRun.cmd</CommandLine>
            </SynchronousCommand>
   </FirstLogonCommands>
        </component>  
  
    </settings>
</unattend>

Wednesday, July 1, 2015

Tor Browser, Raspberry Pi

There are no such thing as Tor Browser on Raspberry Pi. As an quite workaround you have to install vidalia which will enable future to connect to Tor proxy server. Then you can use any available browser on Raspberry Pi and map this browser to use Tor proxy server.

To work with this solution update system:
sudo apt-get update && sudo apt-get upgrade -y
Install vidalia and chromium package:
sudo apt-get install vidalia chromium -y
In vidalia installation proceess you will be prompted to confirm which users are gone use this future. You have to press space to selecti pi user and then hit enter:

Now open Vidalia control panel

Whait till the statuss is connected!

Now you can use command line to open chromium browser with tor proxy server:
chromium --proxy-server="socks5://127.0.0.1:9050"
Now you can go to https://myexternalip.com/raw and see that you are not you anymore ;)

Also you can set tor proxy server to run at startup.
Open rc.local
sudo nano /etc/rc.local
Add /usr/bin/tor & at the end of file:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

/usr/bin/tor &

exit 0

Blog Archive