Skip to content

Instantly share code, notes, and snippets.

View pastranastevenaz's full-sized avatar
🎯
Focusing

Steven Antonio pastranastevenaz

🎯
Focusing
View GitHub Profile
# Create C:\tmp if it does not already exist
if(!(Test-Path -Path C:\tmp)){
New-Item -ItemType directory -Path C:\tmp *>$null
}
# Create function for getting the size of folders
FUNCTION Get-FolderSize {
BEGIN{$fso = New-Object -ComObject scripting.FileSystemObject}
PROCESS{
$path = $input.fullname
@pastranastevenaz
pastranastevenaz / axiosauth.vue
Created March 30, 2020 05:23
Making an http request to a secure API
<template>
<div>
<h1>Example
</div>
</template>
<script>
import axios from 'axios'
export default{
data(){
@pastranastevenaz
pastranastevenaz / powershellcommands.ps
Created January 30, 2020 06:48
Powershell Commands
Enter-PSSession -ComputerName Computer-Name
@pastranastevenaz
pastranastevenaz / macouilookup.sh
Created October 15, 2019 03:57
MAC address OUI lookup linux
#!/bin/bash
OUI=$(ip addr list|grep -w 'link'|awk '{print $2}'|grep -P '^(?!00:00:00)'| grep -P '^(?!fe80)' | tr -d ':' | head -c 6)
curl -sS "http://standards-oui.ieee.org/oui.txt" | grep -i "$OUI" | cut -d')' -f2 | tr -d '\t'
@pastranastevenaz
pastranastevenaz / form.php
Created September 13, 2019 04:16
PHP simple mail form
<?php
if ($_POST[submitted])
{
echo "Process form";
}
else
{
echo <<< _ENDOFFORM_
#!/bin/bash
ping 192.168.1.1 -c 450 | while read ping; do echo “$(date): $ping”; sleep 30; done
ping 192.168.100.1 -c 450 | while read pong; do echo “$(date): $pong”; sleep 30; done
ping google.com -c 450 | while read pang; do echo “$(date): $pang”; sleep 30; done
@pastranastevenaz
pastranastevenaz / wpuser.sql
Created July 17, 2019 06:47
create wordpress users tables
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'demo', MD5('demo'), 'Your Name', 'test@yourdomain.com', 'http://www.test.com/', '2011-06-07 00:00:00', '', '0', 'Your Name');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');
@pastranastevenaz
pastranastevenaz / nginx.conf
Created June 28, 2019 22:15
Enable Gzip Compression in Nginx Server
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
@pastranastevenaz
pastranastevenaz / kubernetes-ubuntu18.04.sh
Created June 11, 2019 09:05
Install Kubernettes goodness on Ubuntu 18.04
#!bin/bash
#get the gpg key
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
#add the kebernetes URI to the sources.list.d repo list
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
@pastranastevenaz
pastranastevenaz / docker-install-ubuntu18.04.sh
Last active June 11, 2019 09:01
The commands to innstall docker on Ubuntu 18.04
#!bin/bash
#add repo gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#add the repo
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"