Diskpart and OEM-recovery partitions

Unhide Recovery Partition

Start Disk Management (diskmgmt.msc) on your computer and take a closer look at your hard disk. Note the disk number and the partitions.
Start DiskPart and select your disk:

DISKPART> select disk 0

List all partitions:

DISKPART> list partition

Now, select the hidden partition (see step 1)

DISKPART> select partition 1
DISKPART> detail partition 

Verify that it is hidden.
Remember the Type value, this will be handy if something goes wrong.
Set the type of the hidden partition to 07.

DISKPART> set id = 07 override

If everything goes ok, you will receive the following message

“Diskpart successfully set the partition ID.“

All done.

DISKPART> Exit 

to close DiskPart.

Check the Disk Management to see witch drive letter has been assigned to the recovery partition.

List of partition types:

07 = Windows NT NTFS, 17 = Hidden, 27 = OEM Recovery

Assuming that you have cloned your hard drive containing the system onto a new one with a different storage capacity. This has made it impossible to create a Recovery drive including the content of the recovery partition, the checkbox “Copy the recovery partition from the PC to the recovery drive” being disabled. The reason is simple: the BCD entries (Boot Configuration Data) are based on disk signature/partition addresses. Therefore, if partitions are moved/resized, BCD entries are no longer actual.

Usually, the PC comes with a hidden Recovery partition which has no assigned letter but only a name, and containing a file named install.wim (or winRe.wim). You cannot display the content of this partition in Windows Explorer because it has no letter. The only thing you might say about it is “this partition starts at a certain offset” (number of bytes from the beginning of the disk). Windows won’t be able to find it if you provide a wrong offset, and this is exactly what happens when you install a new hard drive: the recovery partition may not start at the same offset as on the former one. So you have to provide Windows with the new offset by updating the content of a system file.

First of all, you need to determine which hidden partition contains the recovery file (install.wim or winre.wim). It’s most likely the biggest and last one, and its size should be something like 14 GB or greater. In the image below, which shows the partitions of my own hard drive, the Recovery partition is named PBR_DRV and its size is 24 GB.

1 – Open a command prompt (or Windows PowerShell) with admin rights.
In case you want to make this partition visible in Windows Explorer, so that you can check its content, you need to assign a letter to it.

DISKPART> list volumes
DISKPART> select volume x
DISKPART> assign
DISKPART> remove

2 – Open the XML file C:\Windows\System32\Recovery\ReAgent.xml. Locate the line “PBRImageLocation”. Set its offset and guid accordingly to the values you found above.

3 – Open a new command prompt or Windows PowerShell with admin rights, and enter reagentc /disable, followed by reagentc /enable.

You should now be able to create a Recovery drive with the option “Copy the recovery partition from the PC to the recovery drive” enabled.

Download Windows Iso

Er du ikke i besiddelse af din originale Windows installationsmedie kan du downloade den fra Microsofts website.

Download kræver i de fleste tilfælde den originale installationsnøgle og den sidder som regel på computer kabinettet.

På Lenovo laptops kan den i de fleste tilfælde findes ved at afmontere batteriet.

Med mindre du også har den på ekstern strøm er det en god ide at finde den frem inden du begynder download 🙂

http://www.microsoft.com/en-us/software-recovery

ASUS – rooting MeMO Pad 7 (ME572C)

Rooting device ASUS MeMO Pad 7

http://forum.xda-developers.com/memo-pad-7/help/how-to-root-asus-memo-pad-7-me572c-2014-t2915779

Some information [MeMOPad] ME572C of

Talk about the boring part:

Intel Z3560 / Z3580’s CPU, boot.img / fastboot.img / recovery.img of HEAD_PADDING back UNKNOWN_SIZE is 728 bytes, but BOOTSTUBSTACK_SIZE is 8192 bytes.
RootZenFone change it to use, and then release a small update late.
Inside sideload recovery is bad, adb port can not open, when to get there to do a software update or not repaired, guess should not want people to use it? fastboot there SD Download, it seems the future of factory image will be .raw format.
The more interesting part:

fastboot there is a small back door, can be used to do the root of the application:

fastboot oem mount
The first instruction is to mount partitions on the phone, will be mounted at / mnt / data folder, so I’m going to mount the system is ext4 fastboot oem Mount system , that is, you want to mount userdata fastboot oem mount data ext4 can.

fastboot flash The second instruction is to update the information on the phone route, originally only update existing files , but here I do not know why is modified to replace the existing file or upload , it is very interesting, root application ready. Because it is 4.4 and there is open SELinux, so the best way to modify the existing shell file will be executed, when it related to root after the brush into the program to reboot automatically go into.

The idea is simple:

fastboot oem Mount system ext4
fastboot Flash / mnt / system / xbin / su su
Flash /mnt/system/etc/install-recovery.sh install-recovery.sh fastboot
fastboot Flash /mnt/system/Superuser.apk Superuser.apk
Then find a .sh file can be used to modify the plug plug back in the boot judgment if no /system/etc/.installed_su_daemon run the installation program, produced /system/bin/.ext/ , / system / bin /. ext / su , / system / xbin / sugote , / system / xbin / sugote-mksh , / system / xbin / daemonsu …

FN-debat: Opretholdelse af international fred og sikkerhed

I min ungdom deltog jeg i en del af fredsmarchen fra København til Wien. Som jeg husker det var det i begyndelsen af 80-erne.

Men hvad sker der når vi når til et punkt hvor mennesker beslutter at nu er der fred og sikkerhed?

1 Thess 5:1-5

5 Men med hensyn til tiderne og perioderne, brødre, har I ikke behov for at der skrives til jer, 2 for I ved selv udmærket at Jehovas dag kommer nøjagtig som en tyv om natten. 3 Når de siger: „Fred og sikkerhed!“ da vil pludselig undergang komme over dem ligesom veerne over den gravide; og de skal afgjort ikke undslippe. 4 Men I, brødre, I er ikke i mørke så dagen skulle overraske jer som den ville [overraske] tyve, 5 for I er alle lysets sønner og dagens sønner. Vi hører hverken natten eller mørket til.

Omtale på altinget.dk
http://www.altinget.dk/kalender.aspx?id=26034

Resolution vedtaget på generalforsamlingen 10 September 2015
http://www.un.org/en/ga/search/view_doc.asp?symbol=A/RES/69/316

Windows 10 opgradering – Nej tak

Afinstaller Windows 10 opdaterings app:

Windows 8:

  • Tast Windows + X
  • Klik Kommandoprompt (administrator)
  • I kommando-vindue indtast denne kommando (afslut med Enter):
    wusa /uninstall /kb:3035583
  • Bekræft afinstallering og genstart når du bliver bedt om det.

Windows 7:

  • Klik Start, tast cmd og derefter højre-klik med musen og klik Kør som administrator.
  • I kommando-vindue indtast denne kommando (afslut med Enter):
    wusa /uninstall /kb:3035583
  • Derefter (afslut med Enter):
    wusa /uninstall /kb:2952664
  • Bekræft afinstallering og genstart når du bliver bedt om det.

Hvad nu?

Jeg kan varmt anbefale Open Source. Efter mit ophør på arbejdsmarkedet har jeg endelig fundet kræfter til at sætte mig ind i Linux.

Det er meget bedre. Du vil måske læse nogle af mine opslag om installation af Linux

Setting up a Magento VM (maintenance purpose)

A client recently asked me to move their Magento to another host. A problem arise since the new host do not provide shell access thus maintaining Magento patches became an issue.

I found and forked this from
Credit where credit is due.
https://www.nerdoncoffee.com/uncategorized/setting-up-a-magento-vm-and-allowing-remote-access/

Grab the VMDK from here

https://bitnami.com/stack/magento/virtual-machine
  • Convert to a qcow2 image

    qemu-img convert -f vmdk -O qcow2 bitnami-magento-1.9.1.0-0-ubuntu-14.04.vmdk magento.qcow2

  • Create a vm and set that is the hard disk image

  • Change all interfaces to virtio 14.04 has paravirtual drivers already installed so is good to go. Why ? Because it will speed up slow as Magento
  • Create a bridge
  • Follow the wiki

    https://wiki.archlinux.org/index.php/Bridge_with_netctl

  • Add your interfaces as appropriate e.g

    Description=”Example Bridge connection”
    Interface=br0
    Connection=bridge
    BindsToInterfaces=(eth0 eth1 tap0 enp2s0)
    IP=dhcp

  • Start it and enable it at boot

    sudo netctl start bridge
    sudo netctl enable bridge

  • Change the Nic to use the new bridge (br0) as the Network source

  • Start the VM
  • Configure whatever you like on your vm
    you could use port forwarding, port triggering, dmz, vpn, ssh etc…

As I don’t really care about this little vm (its just for dev purposes) I threw it in the DMZ zone (make sure it has a static IP – I just did a dhcp reservation and set the mac of the vnic)

  • Adding a DNS A record so you don’t have to remember the ip
    log in to your dns registrar (look up terminology) – I use cloudflare so I just added it in there for this blog as magento.nerdoncoffee.com)

  • Modify your vm
    in /opt/bitnami/apps/magento/conf/htaccess.conf php_value memory_limit 512M

  • Update Apache2 on your vm
    [text] #

ServerName magento.example.com

ServerAlias www.magento.example.com

DocumentRoot “/opt/bitnami/apps/magento/htdocs”

#

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#
ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com www.magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#

ServerName magento.example.com

ServerAlias www.magento.example.com

DocumentRoot “/opt/bitnami/apps/magento/htdocs”

SSLEngine on

SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”

SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

#

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#

ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com www.magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
SSLEngine on
SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”
SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”
[/text] OR
[text] ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#

ServerName magento.example.com

ServerAlias www.magento.example.com

DocumentRoot “/opt/bitnami/apps/magento/htdocs”

SSLEngine on

SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”

SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

#

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”

#
ServerName magento.nerdoncoffee.com
ServerAlias magento.nerdoncoffee.com
DocumentRoot “/opt/bitnami/apps/magento/htdocs”
SSLEngine on
SSLCertificateFile “/opt/bitnami/apps/magento/conf/certs/server.crt”
SSLCertificateKeyFile “/opt/bitnami/apps/magento/conf/certs/server.key”

Include “/opt/bitnami/apps/magento/conf/httpd-app.conf”
[/text]

nano /opt/bitnami/apps/magento/conf/htaccess.conf

at the bottom in the directories node

[text] SetEnvIf Host www.magento.nerdoncoffee.com MAGE_RUN_CODE=magento.nerdoncoffee.com
SetEnvIf Host www.magento.nerdoncoffee.com MAGE_RUN_TYPE=website
SetEnvIf Host ^magento.nerdoncoffee.com MAGE_RUN_CODE=magento.nerdoncoffee.com
SetEnvIf Host ^magento.nerdoncoffee.com MAGE_RUN_TYPE=website
[/text] Now uncomment the following file in /opt/bitnami/apps/magento/conf/htaccess.conf
[text]

you can put here your magento root folder

path relative to web root

RewriteBase /magento/
[/text] Restart apache in your vm

sudo /opt/bitnami/ctlscript.sh restart apache

References
* https://bitnami.com/stack/magento/virtual-machine
* https://wiki.archlinux.org/index.php/Bridge_with_netctl
* https://wiki.bitnami.com/Virtual_Appliances_Quick_Start_Guide
* https://wiki.bitnami.com/Virtual_Appliances_Quick_Start_Guide#How_to_enable_sshd.3f

Replace a String in Multiple Files

I recently had to search a huge amount of files (Magento webshop) and replace an url. I did a search an found this.

Credit where credit is due
Forked from http://vasir.net/blog/ubuntu/replace_string_in_multiple_files

I recently had to replace every occurrence of a certain word / string in a ton of files spanning multiple directories, and this is the quickest way I’ve found to do it. It uses grep to search for a certain word and if it find its it runs sed to replace the strings you want. Note: This will not work on windows systems
Basic Format

grep -rl matchstring somedir/ | xargs sed -i ‘s/string1/string2/g’

Note: The forward slash ‘/’ delimiter in the sed argument could also be a different delimiter (such as the pipe ‘|’ character). The pipe delimiter might be useful when searching through a lot of html files if you didn’t want to escape the forward slash, for instance.
matchstring is the string you want to match, e.g., “football” string1 would ideally be the same string as matchstring, as the matchstring in the grep command will pipe only files with matchstring in them to sed. string2 is the string that replace string1. There may be times when you want to use grep to find only files that have some matchstring and then replace on a different string in the file than matchstring. For example, maybe you have a lot of files and only want to only replace on files that have the matchstring of ‘phonenumber’ in them, and then replace ‘555-5555’ with ‘555-1337’. Not that great of an example (you could just search files for that phone number instead of the string ‘phonenumber’), but your imagination is probably better than mine.
Example

grep -rl ‘windows’ ./ | xargs sed -i ‘s/windows/linux/g’

This will search for the string ‘windows’ in all files relative to the current directory and replace ‘windows’ with ‘linux’ for each occurrence of the string in each file.

Whisky

Det hører til i kategorien – Det vil jeg meget nødig have mig frabedt.

Forleden opdagede jeg et dansk whisky destilleri.

http://stauningwhisky.dk

Det vil jeg besøge en gang.

Update 19.11.2015:

Efter min opdagelse købte jeg en af hver via nettet og jeg må sige at de har gjort et godt stykke arbejde.

Som Islay-mand er det første gang jeg smager en Rye og det er sandelig en speciel oplevelse.

Jeg kan sige at som 3 års whiskies er de rasende gode.

Jeg køber dem dog ikke igen – de er de simpelthen for dyre til – men jeg vil stadig gerne besøge distilleriet for en rundvisning.