This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u root --password=XXXXXXXXXXXX bitnami_ghost -e "update users set status = 'active'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' or 1=1-- | |
" or 1=1-- | |
or 1=1-- | |
' or 'a'='a | |
" or "a"="a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |