Skip to content

Instantly share code, notes, and snippets.

View PanjiNamjaElf's full-sized avatar
🐱
Hello nyaa~~~

Panji Setya Nur Prawira PanjiNamjaElf

🐱
Hello nyaa~~~
  • Isekai World
  • 19:58 (UTC +07:00)
View GitHub Profile

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Gotten from the RedHat GPG migration manual

Backup the public and secret keyrings and trust database

## Export all public keys

gpg -a --export >mypubkeys.asc

@PanjiNamjaElf
PanjiNamjaElf / PowerShell Customization.md
Created August 18, 2024 15:11 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@PanjiNamjaElf
PanjiNamjaElf / ConsoleSchedulingTest.php
Created July 4, 2024 09:25 — forked from MattApril/ConsoleSchedulingTest.php
A simple way of testing that your Lumen commands are scheduled exactly when and how you expect. This approach does not trigger commands to actually execute, which is what a lot of other suggestions do.
<?php
use App\Console\Kernel;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Event;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Collection;
class ConsoleSchedulingTest extends TestCase
{
@PanjiNamjaElf
PanjiNamjaElf / nginx.conf
Created September 23, 2023 15:27 — forked from mreschke/nginx.conf
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route

Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM

Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM

@PanjiNamjaElf
PanjiNamjaElf / Foo.php
Created February 11, 2023 07:10 — forked from h-collector/Foo.php
Standalone Laravel Queue + Redis example
<?php
namespace Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Redis\Database as Redis;
class Foo extends Job
{
use InteractsWithQueue;
@PanjiNamjaElf
PanjiNamjaElf / gist:41bc81cc022e5931de2799f4e2766018
Created December 24, 2022 13:54 — forked from snowman-repos/gist:3817385
PHP: Check File Exists and Append Number
function file_newname($path, $filename){
if ($pos = strrpos($filename, '.')) {
$name = substr($filename, 0, $pos);
$ext = substr($filename, $pos);
} else {
$name = $filename;
}
$newpath = $path.'/'.$filename;
$newname = $filename;
@PanjiNamjaElf
PanjiNamjaElf / Backup-and-Restore-GPG-and-SSH-keys.md
Created November 20, 2022 05:39 — forked from colematt/Backup-and-Restore-GPG-and-SSH-keys.md
[Backup and Restore GPG and SSH keys] #git #gpg #ssh

Backup

  1. Copy both id_rsa and id_rsa.pub from ~/.ssh/ to a USB drive. Identify the private key by executing the following command.
    gpg --list-secret-keys --keyid-format LONG
    
  2. It will show something similar to this.
    sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
    

XAMPP - Replace MariaDB with MySQL

Since XAMPP 5.5.30 and 5.6.14, XAMPP ships MariaDB instead of MySQL. MariaDB is not 100% compatible with MySQL and can be replaced with the "orginal" MySQL server.

Backup

  • Backup the old database into a sql dump file
  • Stop the MariaDB service
  • Rename the folder: c:\xampp\mysql to c:\xampp\mariadb