Skip to content

Instantly share code, notes, and snippets.

@frengky
frengky / FingerprintDialogFragment.java
Created August 23, 2018 07:35
Android fingerprint authentication (Encrypt/Decrypt purpose)
public class FingerprintDialogFragment extends BottomSheetDialogFragment {
private static final String TAG = FingerprintDialogFragment.class.getSimpleName();
private static final String TITLE = "title";
private static final String SUBJECT = "subject";
private static final String MODE = "mode";
public static final int MODE_ENCRYPT = Cipher.ENCRYPT_MODE;
public static final int MODE_DECRYPT = Cipher.DECRYPT_MODE;
@frengky
frengky / s3_compatible_object_storage.md
Last active August 22, 2023 02:41
This is a quick start guide to run a S3 compatible open source object storage server using MinIO

Local S3 Object Storage

This is a quick start guide to run a S3 compatible open source object storage server using MinIO.

References

The docker image used in this guide:

@frengky
frengky / linux.md
Created August 9, 2023 04:07
Linux command snippets

List rpm order by size

rpm -qa --queryformat '%10{size} - %-25{name} \t %{version} \t %{os} \n' | sort -rh | head -25 | awk '{print $1/1024/1024, $2, $3, $4}'
@frengky
frengky / nvidia-centos-update.md
Last active July 19, 2023 09:31
Update Nvidia driver on CentOS 7.x after kernel update

Update Nvidia driver on CentOS 7.x

Download the latest Nvidia driver on http://www.nvidia.com/drivers

Update the kernel to the latest version

$ yum update

Change to runlevel 3 - multi user mode for the next reboot

@frengky
frengky / worker_pool.go
Created April 4, 2019 12:10
Worker pool implementation in Go
package msgr
import (
"log"
)
type Task interface {
execute() (string, error)
}
@frengky
frengky / firewalld.md
Last active December 27, 2022 17:28
FirewallD command line snippets for Linux

FirewallD command line snippets for Linux

Create new zone identified by an IP Address or interface This 'example' zone rules will applied to the connection from 192.168.1.2

  $ firewall-cmd --list-all-zones
  $ firewall-cmd --permanent --new-zone=example
  $ firewall-cmd --permanent --zone=example --add-source=192.168.1.2
  $ firewall-cmd --zone=example --list-sources
@frengky
frengky / minio.md
Created July 22, 2022 10:11
S3 Compatible Object Storage Server (MinIO)

S3 Compatible Object Storage Server (MinIO)

1. Download minio and mc binary for linux

Put the binary in /opt/minio/bin:

wget https://dl.min.io/server/minio/release/linux-amd64/minio
wget https://dl.min.io/client/mc/release/linux-amd64/mc
@frengky
frengky / rtorrent.rc
Created December 30, 2015 02:55
Setup systemd with the rtorrent service
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 300
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 1
@frengky
frengky / .php-cs-fixer.php
Created February 5, 2022 05:31
PHP-CS-Fixer 3.x Laravel configuration file
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
@frengky
frengky / nginx-cert.sh
Last active September 18, 2021 12:38
Nginx dynamic document root folder and sub-domain configuration
#!/bin/sh
# Self signed certificate for Nginx HTTPS
#
openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout /etc/nginx/ssl/my-domain.key -out /etc/nginx/ssl/my-domain.crt