Skip to content

Instantly share code, notes, and snippets.

@ekussa
ekussa / shortcutLauncher.cpp
Created September 29, 2023 04:34
ShortcutLauncher
#include <Windows.h>
#include <time.h>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <functional>
#include <thread>
static LRESULT __stdcall HookCallback(int nCode, WPARAM wParam, LPARAM lParam);
// GuessNumber.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <functional>
typedef unsigned long Numero;
typedef unsigned long Tentativa;
enum class Estado
@ekussa
ekussa / live-build
Last active March 22, 2021 19:54
live-build
Install live-build
The live-build package can be found and installed directly from Debian repository, in all the trees, from Debian stable to sid
Install live-build with:
$ sudo apt install live-build
live-build use
Live build package provide the executable lb, used to create the environment, build live distribution and for the cleanup
Configure the environment with lb config
We configure the environment, of our live CD, using lb config inside the git directory:
@ekussa
ekussa / README.md
Created March 15, 2021 13:42 — forked from espinz/README.md
Debian Headless install - simple-cdd

Description

The following will create an automated custom debian iso image using simple-cdd.
Copy the iso to the USB. Plug in the USB and press power; it will automatically restart with a fresh debian install. No prompts, or typing required. Barebone and vm tested.

Jump to Code
Anchor links do not work on github gists. please scroll down.

Install the required package

@ekussa
ekussa / bashDebug.sh
Last active February 13, 2021 13:27
How to place debug on bash
#!/bin/bash
_DEBUG="on"
function DEBUG()
{
[ "$_DEBUG" == "on" ] && $@
}
DEBUG echo 'Reading files'
for i in *
do
@ekussa
ekussa / UnpackAndRepackIso.sh
Created February 8, 2021 20:26
Unpack and repack iso from folder
sudo rmdir /tmp/iso
mkdir /tmp/iso
cd /tmp/iso
sudo mount -t iso9660 -o loop oldIso-xyz.iso /mnt/
cd /mnt
sudo tar cf - . | (cd /tmp/iso; tar xfp -)
sudo xorriso -as mkisofs \
-U -A "volumeName" -V "volumeName" \
-volset "volumeName" -J -joliet-long -r -v -T \
@ekussa
ekussa / squashfs_work.sh
Created February 6, 2021 23:13
unpack and repack squashfs file
mkdir squashfs
cd squashfs
unsquashfs ../filesystem.squashfs
sudo chmod -R 777 squashfs
rm -f ./squashfs/squashfs-root/opt/lenovo/ldiag/*
mksquashfs squashfs-root filesystem.squashfs -comp xz
@ekussa
ekussa / FlashIso.sh
Last active February 6, 2021 19:16
To flash via balena cli - linux
echo ++++++++++++++++++++++++++++++++++++++++++++++++++
echo FLASH ISO
echo ++++++++++++++++++++++++++++++++++++++++++++++++++
echo To: $1
if [ -e /dev/sdb ]
then
echo "Flash drive detected"
else
@ekussa
ekussa / DownloadLastBalenaCli.sh
Last active February 8, 2021 17:24
Download latest release of Balena Cli and Gui from github - Linux
sudo apt install wget curl unzip
# Get latest version url
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/balena-io/balena-cli/releases/latest | grep '"browser_download_url":' | sed -E 's/.*"([^"]+)".*/\1/' | grep 'linux' > balenaCliLink.txt
# Set first line of a file, that contains a url, to a variable
read -r url < balenaCliLink.txt
# Delete from disk, if already downloaded
rm -f ${url##*/}