How to Build Linux Kernel with Android
This guide shows how to build Linux on a Android Device and was made for people that doesn't have s Computer.
- 4GB of free space (2GB if delete the temp files)
- Android 5.0
You need to install Termux
| # I used this shell.nix to build LineageOS 21.0 for redfin (Google Pixel 5) | |
| # | |
| # IMPORANT NOTE: I had to use a pure shell for my builds to work, i.e: `nix-shell --pure` rather than `nix-shell` | |
| # | |
| # The build instructions are here: https://wiki.lineageos.org/devices/redfin/build | |
| # | |
| # Warning (from forked gist, was added August 1st 2018): | |
| # The hardened NixOS kernel disables 32 bit emulation, which made me run into multiple "Exec format error" errors. | |
| # To fix, use the default kernel, or enable "IA32_EMULATION y" in the kernel config. | |
| # |
| #include <linux/module.h> | |
| #include <crypto/hash.h> | |
| struct sdesc { | |
| struct shash_desc shash; | |
| char ctx[]; | |
| }; | |
| static struct sdesc *init_sdesc(struct crypto_shash *alg) | |
| { |
This guide shows how to build Linux on a Android Device and was made for people that doesn't have s Computer.
You need to install Termux
I'm buiding a command line tool in Go that has an option to install itself as a service on Windows, which it needs admin rights for. I wanted to be able to have it reliably detect if it was running as admin already and if not, relaunch itself as admin. When the user runs the tool with the specific switch to trigger this functionality (-install or -uninstall in my case) they are prompted by UAC (User Account Control) to run the program as admin, which allows the tool to relaunch itself with the necessary rights.
To detect if I was admin, I tried the method described here first:
https://coolaj86.com/articles/golang-and-windows-and-admins-oh-my/
This wasn't accurately detecting that I was elevated, and was reporting that I was not elevated even when running the tool in CMD prompt started with "Run as Administrator" so I needed a more reliable method.
I didn't want to try writing to an Admin protected area of the filesystem or registry because Windows has the ability to transparently virtualize those writes
| According to all known laws of aviation, there is no way a bee should be able to fly. | |
| Its wings are too small to get its fat little body off the ground. | |
| The bee, of course, flies anyway because bees don't care what humans think is impossible. | |
| Yellow, black. Yellow, black. Yellow, black. Yellow, black. | |
| Ooh, black and yellow! | |
| Let's shake it up a little. | |
| Barry! Breakfast is ready! | |
| Coming! | |
| Hang on a second. | |
| Hello? |
##Custom SSL Certificate for Windows RDP Service
Requirements
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| SYNOPSIS | |
| python SCRIPT.py [-h,--help] [-v,--verbose] | |
| DESCRIPTION |
| function Send-UdpDatagram | |
| { | |
| Param ([string] $EndPoint, | |
| [int] $Port, | |
| [string] $Message) | |
| $IP = [System.Net.Dns]::GetHostAddresses($EndPoint) | |
| $Address = [System.Net.IPAddress]::Parse($IP) | |
| $EndPoints = New-Object System.Net.IPEndPoint($Address, $Port) | |
| $Socket = New-Object System.Net.Sockets.UDPClient |
| // Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust | |
| // to work with Rust 1.0 beta | |
| use std::net::{TcpStream, TcpListener}; | |
| use std::io::{Read, Write}; | |
| use std::thread; | |
| fn handle_read(mut stream: &TcpStream) { | |
| let mut buf = [0u8 ;4096]; |