Skip to content

Instantly share code, notes, and snippets.

View masgeek's full-sized avatar
🪁
Adapting

Sammy M masgeek

🪁
Adapting
View GitHub Profile
@nakamuraos
nakamuraos / reset-trial-navicat.sh
Last active October 11, 2025 12:39
Reset trial Navicat 15, Navicat 16, Navicat 17 on Linux
#!/bin/bash
set -euo pipefail
# Author: NakamuraOS <https://github.com/nakamuraos>
# Latest update: 03/19/2025
# Tested with Navicat 15.x, 16.x, and 17.x on Debian and Ubuntu.
BGRED="\e[1;97;41m"
ENDCOLOR="\e[0m"
@Daksh777
Daksh777 / office-2019-activate.bat
Last active September 28, 2025 07:40
Activate Office 2019 using a batch script legally by using KMS keys. (Run as administrator)
@echo off
title Activate Microsoft Office 2021 (ALL versions) for FREE - MSGuides.com&cls&echo =====================================================================================&echo #Project: Activating Microsoft software products for FREE without additional software&echo =====================================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2021&echo - Microsoft Office Professional Plus 2021&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo =====================================================================================&echo Activating your product...&cscript //nologo slmgr.vbs /ckms >nul&c
@jferrao
jferrao / haversine.kt
Last active October 8, 2025 07:35
Kotlin implementation of the Haversine formula
class Geo(private val lat: Double, private val lon: Double) {
companion object {
const val earthRadiusKm: Double = 6372.8
}
/**
* Haversine formula. Giving great-circle distances between two points on a sphere from their longitudes and latitudes.
* It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the
* sides and angles of spherical "triangles".
@theodorosploumis
theodorosploumis / install_php.sh
Last active November 29, 2019 11:05
Install php7 with useful extension on Ubuntu xenial 16.10
sudo apt-get purge php5-common -y
#sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y
sudo apt-get install -y \
php \
libapache2-mod-php \
php-fpm \
php-mysql \
php-memcached \
php-pear \
<?php
// Resource: http://stackoverflow.com/questions/4329260/cross-platform-php-to-c-sharp-net-encryption-decryption-with-rijndael
$iv = "45287112549354892144548565456541";
$key = "anjueolkdiwpoida";
$clear = "2310296|340105";
$encrypted = "B/DrahtonRfOMOgkCTcZRcuOdlpc68uKrNp9oCBpchY=";
$block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);