Skip to content

Instantly share code, notes, and snippets.

View nicolasguzca's full-sized avatar
Learning, improving, growing, helping

Nick nicolasguzca

Learning, improving, growing, helping
View GitHub Profile
@nicolasguzca
nicolasguzca / install_wordpress.sh
Last active April 25, 2023 22:16
install_wordpress.sh
#!/bin/bash
#delete vesta default files
rm index.html
rm robots.txt
# Update packages and install necessary tools
@nicolasguzca
nicolasguzca / vesta-user-fix-permission.sh
Created March 18, 2022 04:13 — forked from 0x00dec0de/vesta-user-fix-permission.sh
Fix user permissions to vesta control panel
#!/bin/bash
cd /home/
for i in `ls | grep -v 'lost+found'`; do
if id "$i" &>/dev/null ; then
chattr -i /home/$i/conf
chown -R ${i}:${i} $i
chown root:root /home/$i/conf
chown root:root /home/$i/conf/*
chown root:bind /home/$i/conf/dns/* &>/dev/null
chown Debian-exim:mail /home/$i/conf/mail/* &>/dev/null
@nicolasguzca
nicolasguzca / floating-ip-gateway.sh
Last active August 18, 2021 15:24 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic)
#!/bin/bash
# Force outbound traffic through the attached floating IP
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
Sub ExportSheetsToCSV()
Dim xWs As Worksheet
Dim xcsvFile As String
For Each xWs In Application.ActiveWorkbook.Worksheets
xWs.Copy
xcsvFile = CurDir & "\" & xWs.Name & ".csv"
Application.ActiveWorkbook.SaveAs Filename:=xcsvFile, _
FileFormat:=xlCSV, CreateBackup:=False
Application.ActiveWorkbook.Saved = True
Application.ActiveWorkbook.Close
@nicolasguzca
nicolasguzca / CaptionAmazonService.php
Created September 6, 2019 20:22 — forked from mwleinad/CaptionAmazonService.php
For those that are looking for a way to create an srt or vtt file from Amazon Transcribe Service
<?php
//Not everything will work out of the box for you, as this is just for our application.
//Framework Laravel
namespace Modules\Caption\Services;
//https://github.com/captioning/captioning
use Captioning\Format\WebvttFile;
use ilos\Models\Caption\CaptionRequest;
use Exception;
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer
@nicolasguzca
nicolasguzca / class.database.php
Created August 14, 2019 14:57 — forked from jonashansen229/class.database.php
PHP OOP Database class using MySQLI and Singleton pattern. Only one instance of the class will be made, this requires less memory.
<?php
/*
* Mysql database class - only one connection alowed
*/
class Database {
private $_connection;
private static $_instance; //The single instance
private $_host = "HOSTt";
private $_username = "USERNAME";
private $_password = "PASSWORd";
https://docs.microsoft.com/en-us/aspnet/core/security/authorization/secure-data?view=aspnetcore-2.2
https://www.c-sharpcorner.com/article/role-base-authorization-in-asp-net-core-2-1/
for api:
http://jasonwatmore.com/post/2019/01/08/aspnet-core-22-role-based-authorization-tutorial-with-example-api
the password part:
http://codular.com/introducing-php-classes
https://phptherightway.com/pages/Design-Patterns.html
https://phpenthusiast.com/blog/how-to-autoload-with-composer
Download youtube videos command:
youtube-dl https://www.youtube.com/watch?v=rCFk_sx6gkY -o "%(id)s.%(ext)s"
' or 1=1--
" or 1=1--
or 1=1--
' or 'a'='a
" or "a"="a