Skip to content

Instantly share code, notes, and snippets.

@kostyll
Created October 6, 2015 12:07
Show Gist options
  • Select an option

  • Save kostyll/d730c1ada3e890606bb8 to your computer and use it in GitHub Desktop.

Select an option

Save kostyll/d730c1ada3e890606bb8 to your computer and use it in GitHub Desktop.
sudo upgrade-from-grub-legacy - fix grub
@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 6, 2015

http://askubuntu.com/questions/32499/migrate-from-a-virtual-machine-vm-to-a-physical-system

wget http://launchpadlibrarian.net/112699162/virtualbox-fuse_4.1.18-dfsg-1ubuntu1_amd64.deb
sudo dpkg -i virtualbox-fuse_4.1.18-dfsg-1ubuntu1_amd64.deb

$mkdir /tmp/f
$sudo vdfuse -f /vms_box/win_8_for_dev/win_8_for_dev.vdi /tmp/f

$su
$cd f
$ls
EntireDisk Partition1 Partition2

$mkdir /tmp/part2
$mount Partition2 /tmp/part2/

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 6, 2015

$dd if=/tmpf/Partition2 of=/dev/sda3 ??????

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 9, 2015

Setting a bit

Use the bitwise OR operator (|) to set a bit.

number |= 1 << x;
That will set bit x.

Clearing a bit

Use the bitwise AND operator (&) to clear a bit.

number &= (1 << x);
That will clear bit x. You must invert the bit string with the bitwise NOT operator (
), then AND it.

Toggling a bit

The XOR operator (^) can be used to toggle a bit.

number ^= 1 << x;
That will toggle bit x.

Checking a bit

You didn't ask for this but I might as well add it.

To check a bit, shift the number x to the right, then bitwise AND it:

bit = (number >> x) & 1;
That will put the value of bit x into the variable bit.

Changing the nth bit to x

Setting the nth bit to either 1 or 0 can be achieved with the following:

number ^= (-x ^ number) & (1 << n);
Bit n will be set if x is 1, and cleared if x is 0.

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 14, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 15, 2015

MXE experiments: https://github.com/mxe/mxe
make MXE_TARGETS='i686-w64-mingw32.shared i686-w64-mingw32.static' qt ffmpeg
need to add http://sourceforge.net/projects/dirac/ dirac codec

env_shared.sh

!/bin/bash

export PATH=/cross/mxe/usr/bin:$PATH
export PKG_CONFIG_PATH_i686_w64_mingw32_shared=/cross/mxe/usr/i686-w64-mingw32.shared

cmake -DCMAKE_TOOLCHAIN_FILE=/cross/mxe/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake .

bash

env_static.sh

!/bin/bash

export PATH=/cross/mxe/usr/bin:$PATH
export PKG_CONFIG_PATH_i686_w64_mingw32_static=/cross/mxe/usr/i686-w64-mingw32.static

cmake -DCMAKE_TOOLCHAIN_FILE=/cross/mxe/usr/i686-w64-mingw32.static/static/cmake/mxe-conf.cmake .

bash

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 16, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 19, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 19, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 21, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 22, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 23, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 23, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 23, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 23, 2015

@kostyll
Copy link
Copy Markdown
Author

kostyll commented Oct 23, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment