This file contains hidden or 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
# For modern LG backup files use a script from here: https://github.com/Mysak0CZ/LBFtool | |
# with details from there https://forum.xda-developers.com/android/general/tool-lg-restore-com-lge-bnr-lbf-file-t4053579 | |
# Fair warning, this script was designed for really old version of LGBackup and won't work on with new devices | |
# So, if you don't get what you wanted, try to use every data carving tools you can get | |
# | |
# Also, good person with nickname SEVENTY ONE recommends ExtractJPEG( https://www.gunamoi.com.au/soft/extractjpeg/download.html ) | |
# To, well, extract JPG Images from a backup | |
# 0. You will need 7-zip context menu "Extract here". |
This file contains hidden or 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
#Based on recipe http://code.activestate.com/recipes/576362-list-system-process-and-process-information-on-win/ | |
#also hosted here https://github.com/ActiveState/code/blob/master/recipes/Python/576362_List_System_Process_Process/recipe-576362.py | |
#by winterTTr Dong , http://code.activestate.com/recipes/users/4164498/ | |
#updated by topin89 | |
#License: MIT | |
from ctypes import c_long , c_int , c_uint , c_char , c_ubyte , c_char_p , c_void_p, c_size_t, c_ulong, c_wchar | |
from ctypes import windll | |
from ctypes import Structure | |
from ctypes import sizeof , POINTER , pointer , cast |
This file contains hidden or 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
from PIL import Image | |
import numpy as np | |
IM_LUT=np.array([(255,255,255,255),(0,0,0,255), | |
(255,0,0,255),(0,255,0,255),(0,0,255,255), | |
(255,255,0,255),(255,0,255,255),(0,255,255,255), | |
(128,0,0,255),(0,128,0,255),(0,0,128,255), | |
(128,128,0,255),(128,0,128,255),(0,128,128,255), |
This file contains hidden or 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
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 | |
#include <iostream> | |
void multiprint(){ | |
static constexpr size_t base = __COUNTER__; | |
#define i (__COUNTER__ - base - 1) | |
std::cout << i << std::endl; | |
std::cout << i << std::endl; | |
std::cout << i << " " << i <<std::endl; |
This file contains hidden or 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
//example: | |
//multiprint("I = ")(10)("A")()("U = ")(10)("V")(); | |
//result: | |
//I = 10A | |
//U = 20V | |
// | |
//arguments -- same as Serial.print | |
//no argument -- Serial.println() | |
This file contains hidden or 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 <iostream> | |
class ContinuousAngle { | |
public: | |
auto &reset() { | |
trimmed_angle_ = 0; | |
turns_ = 0; | |
return *this; | |
} | |
This file contains hidden or 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/true;COMPILER_OPTIONS="-std=c99 -g -Wall -Wextra -O0";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@" | |
///bin/true;COMPILER_OPTIONS="-g -Wall -Wextra --std=c11 -O3 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@" | |
// For windows dwellers like me, this will totally work in MSYS2, and most likely in Cygwin and MSYS. | |
// MSYS2 is better, though. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define xstr(a) str(a) | |
#define str(a) #a |
This file contains hidden or 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
struct SaveableData{ | |
uint32_t update_counter; | |
}; | |
struct UploadSafe{ | |
char dummy[64]; | |
uint32_t flag; | |
//Unless more than 64 bytes of global/static variables | |
//added/removed this will be saved | |
This file contains hidden or 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
# https://unix.stackexchange.com/a/384513 | |
# by | |
# https://unix.stackexchange.com/users/10349/ysdx | |
hostname@user:~$ nmcli d | |
DEVICE TYPE STATE CONNECTION | |
wlp3s0 wifi connected InternetSSID | |
wlx8416f91eade2 wifi disconnected -- #your future AP | |
enp2s0 ethernet unavailable -- |
This file contains hidden or 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 <fstream> | |
#include <iostream> | |
#include <string> | |
void writeppm(char const * const image_buffer, | |
int const image_size, | |
int const width, | |
int const height, | |
std::string const filename){ | |
std::ofstream file{filename, std::ios::binary}; |
OlderNewer