View upload-a-file.MD

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

View mac_permissions_to_user.sh
#!/usr/bin/env bash
# Will assign the dir to the current user.
# Usage: sh mac_permissions_to_user.sh the/dir/path
sudo chown $USER "$@1"
View .zshrc
# Print status for all fail2ban jails.
function f2bstall() {
JAILS=($(fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'))
for JAIL in ${JAILS[@]}
do
echo "--------------- 👀 JAIL STATUS: $JAIL ... ---------------"
fail2ban-client status $JAIL
echo "--------------- ... ---------------"
done
}
View Stop Fail2Ban from Banning your DynamicIP by using FreeDNS.md

Stop Fail2Ban from Banning your DynamicIP by using FreeDNS

I was getting banned by f2b sshd for using autossh and since I am at a Dynamic DNS with no way of knowing its range. I started to look for solutions.

Mike Andreasen has been more than helpful in situations like these. You should definitely hire him.

  • Create an account at Afraid DNS
  • Create a subdomain and use your IP with A (https://i.imgur.com/d3xKbAV.png)
  • Open fail2ban jail.local nano /etc/fail2ban/jail.local
  • Then add your sub domain FDNS in ignore ip like ignoreip = 127.0.0.1/8 sub.mooo.com
  • Your logs for f2b will look like this now INFO [sshd] Ignore <IP_HERE> by dns
View invite.php
<?php
/**
* This is a simple script to invite users to your slack
* Replace the subdomain and token in the variables below.
* Upload a logo called "logo.png" to the same directory for your group
* Upload a logo called "slack.png" to the same directory for slack
*/
define('SUBDOMAIN','{YOUR SUBDOMAIN HERE}');
define('TOKEN','{YOUR API TOKEN HERE}');
?>
View _mixins.scss
/* ----------------------------------------------------------------------------
* SCSS Mixins.
* ------------------------------------------------------------------------- */
/**
* MIXIN: for animation delay.
*
* USAGE: aa_delay($value).
*/
@mixin aa_delay($value) {
View curl.md

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
View audacity_audio_editing.md

AUDIO: How to Edit Your Audio in Audacity to Make You Sound Better.

— by https://youtu.be/TYF5ytMDFpA

Requirements

  • Audacity
  • Audio File

Process

  1. Open the file
View gist:ff1747273a456aa55c57fa6adb55f52b
emotion :+1: :-1: :clap: :heart: :sparkles: :v: :zzz:
icon :new: :ok: :cool: :vs: :tm: :warning: :wheelchair: :zap: :art: :bomb: :bulb: :key: :lock: :memo: :mag:
item :book: :gift: :moneybag: :mega: :scissors: :hammer:
device :computer: :iphone: :calling: :email:
human :cop: :runner: :feet: :fist: :punch: :lipstick: :tophat:
food :beer: :cake: :smoking:
behicle :airplane: :bike: :bus: :ski: :taxi: :train:
animal :bear: :fish: :octocat:
nature :fire: :leaves: :star: :sunny:
View signup.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js" ></script>
<title>AJAX Signup</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">