Skip to content

Instantly share code, notes, and snippets.

@mikestecker
mikestecker / optimising-unifi-performance.md
Last active Sep 26, 2021
optimising-unifi-performance
View optimising-unifi-performance.md

optimising-unifi-performance

Below are the key settings that I apply on any unifi installation for optimal performance.

Settings

Settings > Site

  • Ensure Enable Advanced Features is enabled
    This allows you to follow along with the guide in it's entirety.

  • Ensure Automatically Optimise Network and WiFi performance is disabled
    These settings will do a better job.

@ZeroDragon
ZeroDragon / How to clone a git repo to an existing folder (not empty).md
Last active Sep 26, 2021
How to clone a git repo to an existing folder (not empty)
View How to clone a git repo to an existing folder (not empty).md
  1. First get to the existing directory
    $ cd my/folder/

  2. Now start a new git repository
    $ git init

  3. Identify if the current elements on the directory are needed or not and add them to the .gitignore file. When ready...
    $ vim .gitignore

  4. When ready create the first commit on the server

@pamolloy
pamolloy / README.md
Last active Sep 26, 2021
Ubiquiti USG configuration for Wireguard
View README.md

Download the latest ugw3 package from https://github.com/Lochnair/vyatta-wireguard/releases and install it on your USG using dpkg -i wireguard-ugw3-<version>.deb.

cd /config/auth
umask 077
mkdir wireguard
cd wireguard
wg genkey > wg_private.key
wg pubkey < wg_private.key > wg_public.key
@dungsaga
dungsaga / sync-time.sh
Last active Sep 26, 2021
sync local clock in bash without NTP
View sync-time.sh
# I want to sync the local clock but don't have access to any NTP server.
# Websites such as https://time.is give me the correct time and I can manually adjust the local clock.
# But then I recall that a HTTP response often contains a date header with current time in GMT timezone.
# I'll use it to set the system clock with the precision of 1 or 2 seconds.
# in Linux
sudo date -us "$(curl -Is google.com | grep '^Date:' | cut -d' ' -f3-)"
# in Linux with fish shell
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created Nov 21, 2019
Conversion between String, str, Vec<u8>, Vec<char> in Rust
View string-conversion.rs
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
View mysql_cheat_sheet.md

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

View bbprograms.txt
google dork -> site:.co.uk inurl:"responsible disclosure"
https://registry.internetnz.nz/about/vulnerability-disclosure-policy/
http://www.123contactform.com/security-acknowledgements.htm
https://18f.gsa.gov/vulnerability-disclosure-policy/
https://support.1password.com/security-assessments/
https://www.23andme.com/security-report/
https://www.abnamro.com/en/footer/responsible-disclosure.html
https://www.accenture.com/us-en/company-accenture-responsible-disclosure
https://www.accredible.com/white_hat/
https://www.acquia.com/how-report-security-issue
View bug bounty dorks.txt
responsible disclosure reward r=h:UK
site:*.*.nl intext:security report reward
inurl:responsible disclosure reward
inurl:responsible disclosure bounty
inurl:responsible disclosure swag
site:*.*.nl intext:responsible disclosure reward
responsible disclosure reward r=h:eu
View Ambiente Windows.md

Ambiente Windows

Vamos configurar nosso ambiente de desenvolvimento, instalando ferramentas básicas para iniciarmos no mundo da programação.

Instalar Chocolatey

Chocolatey é um gerenciador de programas e nos ajudará a instalar os programas de maneira programática, pelo terminal do Windows.

  1. Abra o PowerShell como administrador ( clique com o botão direto do mouse no ícone do PowerShell e procure a opção Abrir como Administrador )
  2. Coloque o código abaixo e dê ENTER
@reecelucas
reecelucas / useScrollBlock.js
Last active Sep 26, 2021
React hook to enable/disable page scroll
View useScrollBlock.js
import { useRef } from 'react';
const safeDocument = typeof document !== 'undefined' ? document : {};
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export default () => {
const scrollBlocked = useRef();