DISK=/dev/disk/by-id/ata-VBOX_HARDDISK_VBf3bca3fc-20a6ea2d
parted -s ${DISK} -- mklabel gpt
parted -s ${DISK} -- mkpart primary 512MiB -8GiB
parted -s ${DISK} -- mkpart primary linux-swap -8GiB 100%
parted -s ${DISK} -- mkpart ESP fat32 1MiB 512MiB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// a is an input parameter | |
// b is an input parameter | |
// return the result | |
int divide_1(int a, int b) { | |
return a / b; | |
} | |
// But what if we need to return an error code? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake -DANDROID_NDK=/opt/android-ndk/android-ndk-r10e -DANDROID_ABI="armeabi" -DANDROID_NDK_HOST_X64="YES" -DANDROID_TOOLCHAIN_NAME="arm-linux-androideabi-4.9" -DCMAKE_TOOLCHAIN_FILE="/opt/android-ndk/build/cmake/android.toolchain.cmake" -DWITH_TLS=OFF -DWITH_THREADING=OFF .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE projects SET identifier = 'new_identifier' WHERE identifier = 'current_identifier'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
init() { | |
ip link set can0 type can bitrate 250000 | |
ip link set can0 up | |
} | |
rawdump() { | |
candump can0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "${1}" == "forever" ]; then | |
while sleep 1; do "${0}"; done | |
exit 0 | |
fi | |
export DISPLAY=:0 | |
# url="http://jsfiddle.net/gionaf/Ugc5g/embedded/result/" |
Unmanaged C code:
typedef void(read_fun_t)(void* user_data, const char* data, int data_len);
int native_consume_all(native_handler handler, void* user_data, read_fun_t* read_fun);
Managed C++ code:
VirtualBox gust screen resolution doesn't work well under i3wm, sometime it get stuck at some strange resolution.
This script can fix the window size.
From the guest side, we use VBoxManage to tell the guest that a new resolution is available.
Window is made floating, then the border is removed (it count as width/height), then the window is resized.
In Linux, my Brother MFC-J480DW cuts off top margin when used with A4 paper, even if all settings are set to A4.
To make it work, I had to edit /opt/brother/Printers/mfcj480dw/inf/brmfcj480dwrc
file (that's the path in Gentoo, it could be different in other distributions).
And change:
PaperType=Letter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
init() { | |
ip link set can0 type can bitrate 250000 | |
ip link set can0 up | |
} | |
rawdump() { | |
candump can0 | |
} |