Run a bash script and have a main() function like in C.
How to run a bash function when a script runs. This is just like the main() function in C.
How to run a bash function when a script runs. This is just like the main() function in C.
How to fix the annoying keybinds in Byobu when using it over SSH. This interferes with the keys in Midnight Commander.
A great printer for the home and office, this is a nice multi-function printer and scanner with fax capability.
Calling a function from a trigger in Arma 3 can be very tricky, this is how I managed to do it. commanderDead = { [’task2′,’SUCCEEDED’] call BIS_fnc_taskSetState; { _x setMarkerPos getPos house1; } forEach ["hqMarker", "hqCircle"]; [player, player, opfor, ["LOP_AFR_OPF_Infantry_IED","LOP_AFR_OPF_Infantry_Corpsman","LOP_AFR_OPF_Infantry_GL","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_Rifleman_4","LOP_AFR_OPF_Infantry_AR_Asst_2","LOP_AFR_OPF_Infantry_AT","LOP_AFR_OPF_Infantry_Rifleman_8","LOP_AFR_OPF_Infantry_Rifleman_5"], 16, 120] spawn BIS_fnc_spawnEnemy; private _attack = [] spawn KER_fnc_attackers; }; man2 = createTrigger … Read more
This simple program is a Hello World example that does not use the main() function. This is certainly possible in a C program. #define syscall(a, D, S, d) __asm__ __volatile__("syscall" : : "a"(a), "D"(D), "S"(S), "d"(d)) void _start(void) { syscall(1, 1, "Hello, World\n", 14); syscall(60, 0, 0, 0); }#define syscall(a, D, S, d) __asm__ … Read more
There does not seem to be a good way on Linux to get the free disk space of your / partition with a C function. This is very annoying. I tried to update my system information program with a simple function that shows free disk space with C and I could not get the statfs64() … Read more
Do a simple function call in C. This code snippet shows how to do this This simple C code snippet shows how to do a function call in C. This calls the hi() function and runs it in main(). Very simple but useful code. And this does not need to call any include files. As … Read more
There has been a story floating around the Internet that Linux was vulnerable to a buffer overflow when a USB device with a name longer than 80 characters was plugged in. They were using strcpy(3) to receive the data string containing the name of the device, but that is vulnerable to attack, it is better … Read more