Skip to content

Instantly share code, notes, and snippets.

@elvis501
elvis501 / CF-U1-BIOS.md
Created March 22, 2025 15:34 — forked from en4rab/CF-U1-BIOS.md
Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

A mess of my own making

While messing with a CF-U1 handheld PC that I bought off ebay I managed to mess up the BIOS and it seems it reverted to previous settings which included an unknown BIOS password, it would however still boot into windows. Since I could still boot windows I was able to dump the bios flash using AFUWINGUI.EXE the version I used was 3.09.03.1462 which is available here:
https://www.ami.com/support-other/ Click on Aptio 4 AMI Firmware Update Utility

@elvis501
elvis501 / rand.sh
Created January 6, 2021 18:15
ash PoorManRandomGenerator
#!/bin/sh
# Get a random number on Windows BusyBox alike, also works on most Unixes
PoorMansRandomGenerator() {
local digits="${1}" # The number of digits of the number to generate
local minimum=1
local maximum
local n=0
I did the following to install devtoolset-7:
yum install centos-release-scl
yum install devtoolset-7-gcc-c++
Every time I want gcc to default to using GCC 7, I run the following:
scl enable devtoolset-7 bash
@elvis501
elvis501 / termcolored.php
Created June 17, 2020 10:49
Terminal colors in command line php scripts
<?
$_colors = array(
'LIGHT_RED' => "[1;31m",
'LIGHT_GREEN' => "[1;32m",
'YELLOW' => "[1;33m",
'LIGHT_BLUE' => "[1;34m",
'MAGENTA' => "[1;35m",
'LIGHT_CYAN' => "[1;36m",
'WHITE' => "[1;37m",
@elvis501
elvis501 / php7-fpm_xdebug_nginx.md
Created June 15, 2020 19:45 — forked from rahilwazir/php7-fpm_xdebug_nginx.md
Quick guide to setup Nginx with PHP7-FPM and XDebug

PHP7

  • Ubuntu 16.04+
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install nginx php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-phpdbg php7.1-mbstring php7.1-gd php7.1-imap php7.1-ldap php7.1-pgsql php7.1-pspell php7.1-recode php7.1-soap php7.1-tidy php7.1-dev php7.1-intl php7.1-curl php7.1-zip php7.1-xml php-xdebug
@elvis501
elvis501 / smb.conf
Created June 12, 2020 08:16 — forked from sytkov/smb.conf
/etc/samba/smb.conf
semanage fcontext -a -t samba_share_t /root/downloads
chcon -R -t samba_share_t /root/downloads
@elvis501
elvis501 / gist:e013741fa18adaa0c6b7f68d479592fb
Created April 24, 2020 10:06
javascript to log directly to html
function log(s) {
var p = document.createElement("p");
p.style.wordWrap = "break-word";
p.textContent = s;
output.appendChild(p);
}
@elvis501
elvis501 / index.html
Created March 17, 2020 13:27 — forked from jonnyreeves/index.html
JavaScript Class Structure using requireJS. The following code shows you how to create a Class definition in one JavaScript file and then import it for use in another; coming from an ActionScript 3 background this (and some of JavaScript specific traits)
<!DOCTYPE html>
<html>
<head>
<script data-main="usage" src="http://requirejs.org/docs/release/1.0.8/comments/require.js"></script>
</head>
<body>
<p>Check your JavaScript console for output!</p>
</body>
</head>
@elvis501
elvis501 / SkelClass.js
Created March 12, 2020 18:06
js Class Skeleton
(function (global) {
function SkelClass() {
// handle cases where "new" keyword wasn't used
if (!(this instanceof SkelClass)) {
return new SkelClass(arguments[0]);
}
// if no arguments, then nothing needs to be set
if (arguments.length === 0)
throw new Error('Missing Argument: You must pass a valid argument');
#!/bin/sh
N=/dev/null;
C=`tput op` O=$(echo -en "\n`tput setaf 2`>>> `tput op`");
for mod in $(cat /proc/modules|cut -d" " -f1);
do
md=/sys/module/$mod/parameters;
[[ ! -d $md ]] && continue;
m=$mod;
d=`modinfo -d $m 2>$N | tr "\n" "\t"`;