Raspberry Pi3 installation and configure wlan/wifi (raspbian)

Today I’m setting up the raspi3 that I recently got from the pihut.
https://thepihut.com/
The pi3 has wifi built in (2.4Ghz only).

I use linux now, so in order to set it up with raspbian I performed the following steps.

Get the latest raspi (lite) image here: (I install all software by hand)
https://www.raspberrypi.org/downloads/

Unzip the image with:

unzip [filename]

I got an 8Gb SD card laying abouts. To write the unpacked image  [.img] to the SD card, do the following on linux [you may want to carefully watch where the kernel put you card-device with e.g. the command:]

dmesg

write the data:

dd if=2016-03-18-raspbian-jessie-lite.img of=/dev/mmcblk0 bs=1M

after a while it’s done. To perform a sync to flush all buffers, do:

sync
sync

and unplug the card, put it in your raspi, and turn it on.

To configure the pi from scratch, I connect it with an ethernet cable (no display). By default, the raspi image has eth0 on dhcp. I look up the address it got in my router, or use an ip scanner on my local network to see what it has become.

When you’ve located it, ssh to the IP address:

ssh pi@xx.xx.xx.xx

(where xx stands for the IP)
By default, the image has the password “raspberry” for user “pi”

Great to change that immediately.

sudo passwd pi
 [wisely choose a password]
 [enter it correctly again]

I want to change the root password immediately as well:

sudo passwd root
 [wisely choose a password]
 [enter it correctly again]

Now you’re still on eth0, and perhaps you want to use wifi.

Use your favorite editor like vi or nano to edit the following two files to configure it (I usually just do this with su – [password] as root/uid0 or you can do it as user pi with sudo):

(found at http://weworkweplay.com/play/automatically-connect-a-raspberry-pi-to-a-wifi-network/)

vi /etc/network/interfaces

and change the contents to:

auto wlan0

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.100.200
netmask 255.255.255.0
gateway 192.168.100.254
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Change the ip adresses and network settings for your network, or leave these entries and specify: iface wlan0 inet dhcp (for dhcp, for just interface wlan0, leave the other entries intact)

and

vi /etc/wpa_supplicant/wpa_supplicant.conf

to change the wifi settings for your network:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="SSID"
psk="verysecret!"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

proto=RSN stands for WPA2

Of course you may want to update your pi:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Reboot, and possibly do this again, maybe an apt-get autoremove is neccesary afterwards.

You’re now set up with your pi, you can use

raspi-config

to enable the camera or enable SPI or I2C, or other settings or functions, etcetera.
Don’t forget to expand the filesystem on the sd card, see raspi-config main menu, there’s an entry for it there.

Hope this helps you!
Have fun!

Posted in raspi | Comments Off on Raspberry Pi3 installation and configure wlan/wifi (raspbian)

VMWare virtualise a Windows 2008R2 server with P2V

I am being in the process of virtualising a Windows 2008 R2 server with P2V.
That is, from HP hardware to VMWare.
Since this is a hardware HP machine, I have made the following considerations using P2V.

Before virtualising:

– Make sure that the P2V-tool assigns each disk to a vmdk, by default it makes one big disk, something you may not want. (it handy to slice it up, in case you want to change datastore, or perhaps make a change in cluster size later.)
– Set the name of the server right, it reflects this in the datastore directory.
– Set the CPU right, I usually take 2 cpu, 2 cores, but ofcourse that is up to you or your licensing model.
– In P2V, deselect the option to install VMWare tools, do it manually later, or your sever may hang.

Make sure you stop Exchange services (taking the exchange server offline, so it stops mail reception and delivery, –if you have an Exchange server, it was in this case.).
Stop all HP services (set the services to manual, so that they don’t start once virtualised).

After virtualising:

– First start the server in safe mode, to make sure the new “hardware” drivers install correctly.
– Reboot the server, boot normally, install VMware tools.
– Remove any network cards in VMWare and add the VMX3 net network card.
– Set  IP, netmask, gateway, dns entries as before/recommended. A message will show in Windows that there is a card that has these settings, this message will resolve that.

– Deinstall HP software
o (Eventually. you may need to stop HP Services)
o (Eventually, you may need to kill the HP Insight management in task manager)
o (Eventually, you may need to kill other HP processes with task manager)
– Activate Windows, because of hardware changes, key should still be the same.
– Deinstall disconnected drivers in Device Manager:
– In cmd, execute:
set devmgr_show_nonpresent_devices=1
devmgmt.msc
– From the menu, select: Show hidden devices
– You can now remove all drivers that are not in use with [del] [enter]. Do not forget to remove software when the deletion of the driver gives this option.
– Do not deinstall fs_rec, this is supposed to be a MS driver of sorts.
– Finally reboot, done!

Hope this helps you, have fun!

P.S. there are more considerations when pushing an Exchange to VMware, such as disk cluster size, IOps etc, but I won’t cover that in this post. More on that here: http://www.vmware.com/files/pdf/exchange-2010-on-vmware-best-practices-guide.pdf

 

Posted in VMware, Windows | Comments Off on VMWare virtualise a Windows 2008R2 server with P2V

raspi raspbian compile ffmpeg

Edit: It is called avconv, duh! You can use this now:

https://www.raspberrypi.org/documentation/usage/camera/raspicam/README.md

Today I’m setting up a raspi with raspbian and a raspi camera.
After enabling the camera (with rapi-config as root) I wanted to test it wtih ffmpeg.
Which wasn’t there.

In order to compile it from source with h264 support, first install the h264 libs:

git clone git://git.videolan.org/x264
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
make -j4
sudo make install

I just want video output, so I skipped the audio requirements (or else you should install these now). So I continued with ffmpeg itself:

cd /usr/src
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
make -j4
sudo make install

Now you have to wait a long time for it to finish.

Found at: http://www.jeffreythompson.org/blog/2014/11/13/installing-ffmpeg-for-raspberry-pi/

Posted in News | Comments Off on raspi raspbian compile ffmpeg

Don’t start Win10 update

In order to make sure things are blocked when it comes to the win10 update.

in a batch file:

REM === Windows 10 update block ===
MKDIR C:\Temp > nul
COPY \\SERVER\NETLOGON\NoWin10.reg C:\Temp\NoWin10.reg > nul
regedit /s C:\Temp\NoWin10.reg
del C:\Temp\NoWin10.reg > nul

In the NoWin10.reg the data is:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GWX]

"DisableGWX"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]

"DisableOSUpgrade"=dword:00000001

Hope this helps you, have fun!

Posted in News | Comments Off on Don’t start Win10 update

Group Policy Update for Windows Operating System Updates

On further investigation of previous post(s), I have now learned that Microsoft has an update for Windows Update and Group Policies.

Basically, there is an update that should be installed on Domain servers and workstations that will add the option to turn of Upgrades/Updates to new versions of Windows.

Info about this and about GPO settings:

https://support.microsoft.com/en-us/kb/3080351

The update:

https://support.microsoft.com/en-us/kb/3065987

This is better than scripting your way around the problem, unless you have standalone workstations.

Hope this helps you, have fun!

Posted in News | Comments Off on Group Policy Update for Windows Operating System Updates

Hiding Windows update KB3035583

Microsoft gets relentless with their Windows 10 update.

Fine in bigger companies where you have WSUS. In smaller companies you may not use WSUS, and windows 10 gets pushed as a regular update now.

If you may not want this, and the update is installed, perform the following command:

wusa /uninstall /kb:3035583 /quiet /norestart

If you may not want this, and the update is not yet installed, you can hide it with the following vb-script:

(Note: You may have to run windows update ‘check for updates’ for it to see which updates are actually available, before you run the script, or you could just run this at startup, haven’t tested this yet)

' Hide KB3035583
' Modified from http://ss64.org/viewtopic.php?pid=6795
Dim hideupdates(0)
'Hide Windows 10 downloader update
hideupdates(0) = "KB3035583"
set updateSession = createObject("Microsoft.Update.Session")
set updateSearcher = updateSession.CreateupdateSearcher()
set searchResult = updateSearcher.Search("IsHidden=0 and IsInstalled=0 and Type='Software'")
For i = 0 To searchResult.Updates.Count-1
 set update = searchResult.Updates.Item(i)
 For j = LBound(hideupdates) To UBound(hideupdates) 
  'MsgBox hideupdates(j)
  if instr(1, update.Title, hideupdates(j), vbTextCompare) = 0 then
     'Wscript.echo "No match found for " & hideupdates(j)
  else
   Wscript.echo "Hiding " & hideupdates(j)
   update.IsHidden = True
  end if
 Next
Next

Execute this with e.g. C:\Temp\cscript hidekb.vbs

I haven’t made this, see original post, found at http://ss64.org/viewtopic.php?pid=6795

If you change Dim hideupdates(0) to Dim hideupdates(7) you can add more updates to hide in the same manner:

hideupdates(0) = “KB3035583”
hideupdates(1) = “KBxxxxxx”
etc. and it will search for them, and hide them.
It displays what updates are being hidden as output.

Hope this helps you! Have fun!

 

Posted in Windows | Comments Off on Hiding Windows update KB3035583

Windows Server 2008 r2 Domain Controller boots into Active Directory Repair

Problem!

My Windows 2008 R2 DC (the only one) boots into Active Directory Repair mode.
Now I can’t log in, because the Active Directory services aren’t started.
I can’t even restart the system correctly, running as a VMware virtual machine, because the VMware tools do not respond, bah.

Solution? [power off… eek hmz]
Boot into safe mode with command line (hey, now you can log in, because the AD services are started!)

type the following commands:

bcdedit /set safeboot dsrepair

bcdedit /deletevalue safeboot

shutdown -f -r -t 1

It is said it works for windows server 2012 as well.

If this doesn’t work, you probably have damaged something in AD, and you should dig a little deeper.
Perhaps even this ? http://distefano.biz/blog/index.php/2013/01/22/windows-server-2008domain-controller-failed-to-start/

I hope you are happy again.

Posted in News | Comments Off on Windows Server 2008 r2 Domain Controller boots into Active Directory Repair

Stacking some images with convert

Today I remembered I was reading on the web, somewhere I don’t remember, someone asked about stacking images that were grabbed from a webcam into one file, to create a kind of ghost effect.

Playing around with ffmpeg and convert I was able to create a little script that captures a frame from /dev/video0, save it as a file, and merge it into some kind of end result: a jpg picture 🙂

# Example of catching a live feed with ffmpeg, and merging the captured images with convert

i=0;

# We start the loop 
while true; do

# Now we capture the image
ffmpeg -nostats -loglevel 0 -i /dev/video0 -vframes 1 -s 1024x768 -f mjpeg -y jpg-$i.jpg

((i++))

# We convert to an average 
convert *.jpg -evaluate-sequence mean a.jpg

# We're done, repeat
done

Ofcourse, convert will take longer and longer to process all the files, but I do this to create the best effect.
Maybe you can even use the convert cmd this way to create star trail pictures, I’ll have to try that one day.

You could keep it simpler, and just capture 2 files, and merge that into one new file, capture a new file it, merge that, etc., but then the ghost  effect dissipates quickly.

It is fun to play around with concepts like these using linux. It is very powerful do be able to do this kind of thing from the command line.

Next time I want to post something about video streams and how to use ffmpeg and ffserver, I’ll keep you posted.

Have fun!

Posted in convert, ffmpeg, linux | Comments Off on Stacking some images with convert

linux ssh access to Zyxel NSA 320

Thanks to the guys over at NAS-central, who document their stuff well, I can now use my Zyxel NSA 320 directly on the network, over secure shell.

In my case this is handy because I can now easily backup the home directory on my linux laptop directory to my home NAS over the wifi, using scp.

In order to achieve this I obtained a copy of this archive: http://downloads.zyxel.nas-central.org/Users/Mijzelf/zypkg-repo/NSA320/4.70/zypkg/ (Since I have an NSA320, with firmware 4.70). What I’ll do with these files follows later in this post.

I followed the instructions here to be able to log in as root: http://zyxel.nas-central.org/wiki/Telnet_backdoor so I created the link, and opened it, in my case something like:

http://nas/r41794,/adv,/cgi-bin/remote_help-cgi?type=backdoor

As a web page this does nothing, it launches an executable on the nas. So I could telnet in with

> telnet nas
login: admin
passwd: <the one that I set when I configured an admin account on the nas>

> /sbin/makekey
Got a passwd: jk4blabla
logged out of the telnet, and directly back in:
> telnet nas
login: NsaRescueAngel
passwd: jk4blabla

set a new password for root
> passwd root

I enabled the admin share to be able to use it remotely to remove and replace files. With e.g. Thunar, I opened the link:

smb://nas/admin/zy-pkgs/

made a new directory ‘old’ and moved all current files in that directory to the old directory (just in case I want it back).

I copied the obtained archive to the smb://nas/admin/zy-pkgs/ directory. Next I went in to the settings page, and went to nas/system settings/Firmware/Packages, then tab Package and hit the refresh button. I installed the packages Metarepository, Random tools and ffp. After reboot, ssh is enabled and you can log in as root or a user, generate ssh keys etc.

Now I have access with ssh, I can use scp to copy my files over the network.

Thank you guys over at NAS-central!

Have fun!

Posted in News | Comments Off on linux ssh access to Zyxel NSA 320

Windows 10 Start menu doesn’t work, fix from command line

If in Windows 10 your start menu doesn’t work, try the following:

1. Create a shortcut on your desktop to powershell.

Right click on the desktop, choose new shortcut, type powershell and press enter, press enter. Right click the icon of the newly created shortcut and choose “Run as Administrator”
click Yes if you get a question about making changes to your machine (because that is what we are going to do).

2. Create a new account (from command line that is as follows:)

net user adm adm /add

3. Log off your account, and log in as adm with password adm

4. Repeat step 1 for this adm account, and “Run as Administrator”

5. Move the old start menu database directory to something else.
(replace [account with problems] to your account name, you may want to look this up with doing the cmd ‘dir’ in the directory C:\Users)

mv C:\Users\[account with problems]\AppData\Local\TileDataLayer\Database C:\Users\[account with problems]\AppData\Local\TileDataLayer\Database.old

6. Copy the newly created and fresh start menu database to your original account.

(replace [account with problems] to your account name, you may want to look this up with doing the cmd ‘dir’ in the directory C:\Users)

cp C:\Users\adm\AppData\Local\TileDataLayer\Database C:\Users\[account with problems]\AppData\Local\TileDataLayer\

7. Log in with original account

Now you can log in with your original account again, and have a clean start menu.
You must add your icons again though.

8 Clean up

Open Settings-> Accounts and remove the adm account.

If it works, with explorer, remove the directory C:\Users\[account with problems]\AppData\Local\TileDataLayer\Database.old

If it doesn’t work, I have no other solutions for you, just continue googling :/

 

Shame Microsoft, it really is some sort of bug you have here in this new Start menu database system you’ve created but not tested.

Posted in Bugs, News, Windows | Comments Off on Windows 10 Start menu doesn’t work, fix from command line