Skip to content

Instantly share code, notes, and snippets.

View xardit's full-sized avatar
🍀

Ardit Hyka xardit

🍀
View GitHub Profile
@xardit
xardit / git-auto-sign-commits.sh
Last active January 10, 2021 15:08 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@xardit
xardit / Setup WSL 2 with Kali or Ubuntu with Desktop View on Windows 10.md
Last active February 17, 2021 10:10
Setup WSL 2 with Kali or Ubuntu with Desktop GUI on Windows 10

Setup WSL 2 (Windows Subsystem for Linux) with Kali or Ubuntu with Desktop GUI on Windows 10

Requirement

Windows 10 minimum version 2004 Build 19041 (find it by using Win+R, type winver then [ENTER] )

Steps

  1. Run PowerShell as Administrator and type
@xardit
xardit / Simple wireguard + cloudflare 1.1.1.1 warp free vpn setup for macos
Last active August 1, 2023 02:32
Simple wireguard + cloudflare 1.1.1.1 warp free vpn setup for macos
Release executable binary downloaded from:
https://github.com/ViRb3/wgcf
# Release file name is currently
wgcf_1.0.6_darwin_amd64
# install to local bin
chmod +x wgcf_1.0.6_darwin_amd64
cp wgcf_1.0.6_darwin_amd64 /usr/local/bin
@xardit
xardit / db.class.php
Created February 10, 2020 10:41
mysql db class simplified queries in PHP
<?php
@date_default_timezone_set('Europe/Rome');
_init_magicQuotes();
$db=new db;
$conn=$db->conn();
@xardit
xardit / Commenting out JSX in Sublime Text 3.md
Last active December 13, 2019 13:59
Commenting out JSX in Sublime Text 3

This is a short post to show you how to enable JSX commenting in Sublime Text 3. At the end of this post you will be able to comment and uncomment JSX by pressing CMD + / or Ctl + /

Overview

Here are the steps we will be taking. First we will install the ‘Babel’ package to add support for JSX. Then we will disable the ‘JavaScript’ package so it’s settings don’t override Babel’s settings. Finally we will modify the Babel package to add support for JSX commenting. Lets get started!

Install Babel Package

  1. Open Sublime and in the menubar select Tools->Command Palette.

Before you start

Make sure you have python, OpenFace and dlib installed. You can either install them manually or use a preconfigured docker image that has everying already installed:

docker pull bamos/openface
docker run -p 9000:9000 -p 8000:8000 -t -i bamos/openface /bin/bash
cd /root/openface
@xardit
xardit / encrypted-git-repo.md
Created February 27, 2019 19:54
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang ([email protected]). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@xardit
xardit / gist:b8ed341cba8b5c87516b8b67a84d1401
Created November 4, 2018 10:21
node.js crypto simple aes 256 encryption
const crypto = require('crypto')
var sharedSecret = crypto.randomBytes(32); // should be 128 (or 256) bits
var initializationVector = crypto.randomBytes(16); // IV is always 16-bytes
// var initializationVector = '0123456789abcdef'
var plaintext = "Everything's gonna be 200 OK!";
var encrypted;
@xardit
xardit / gist:85fb6b1b5618814ba941f687ce4216b6
Created August 16, 2018 21:31 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@xardit
xardit / gps.js
Last active May 14, 2019 06:32
gps.js - a react component for getting a promise of GPS coordinates for iOS and Android
/*
* Get GPS coordinates promise for Android and iOS
* This React Native component fixes the particular error that comes from Android: "location request timed out"
* @author a3diti
* 0x332D7E58
USAGE:
import getCoordinates from './gps'
getCoordinates().then(position => {
const coordinates = position.coords.latitude+','+position.coords.longitude