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 | |
| function getOTP($secret, $time) { | |
| $counter = floor($time/30); | |
| $arr_map = array_flip(str_split("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567")); | |
| $arr_secret = str_split(preg_replace('/[^A-Z2-7]/', '', strtoupper($secret))); | |
| $bin_secret = ""; |
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://s3.amazonaws.com/webdigi/VPN/Unified-Cloud-Formation.json |
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
| You can verify which Active Directory users and groups have been imported to the FreeNAS® system by using these commands within the FreeNAS® Shell. To view users: | |
| wbinfo -u | |
| To view groups, use: | |
| wbinfo -g | |
| https://forums.freenas.org/index.php?threads/how-to-properly-setup-freenas-to-use-active-directory-folder-file-user-permissions.20610/ |
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
| def getDistro(): | |
| os.system("cat /etc/*release > getdistro") | |
| file = open("getdistro", "r") | |
| content = ''.join(file.readlines()) | |
| file.close() | |
| os.remove("getdistro") | |
| _os = "undef" | |
| _ver = "undef" |
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
| <VirtualHost _default_:443> | |
| ServerAdmin [email protected] | |
| ServerName your_domain.com | |
| ServerAlias *.your_domain.com | |
| DocumentRoot /var/www/html | |
| ErrorLog ${APACHE_LOG_DIR}/error.log | |
| CustomLog ${APACHE_LOG_DIR}/access.log combined | |
| SSLEngine on |
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
| openssl x509 -in mycert.crt -out mycert.pem -outform PEM |
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
| /etc/init.d/mysql stop | |
| echo "UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;" >> /home/mysql-init | |
| mysqld_safe --init-file=/home/mysql-init & | |
| rm /home/mysql-init | |
| /etc/init.d/mysql stop | |
| /etc/init.d/mysql start | |
| or | |
| /etc/init.d/mysql stop |
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
| Client | |
| ssh-keygen -t rsa | |
| eval "$(ssh-agent -s)" | |
| ssh-add ~/.ssh/id_rsa | |
| cat ~/.ssh/id_rsa.pub --> copy | |
| Client (to automatically remain the passphrase) |
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
| nano /etc/ssh/sshd_config | |
| Match Group sftp | |
| ChrootDirectory %h | |
| ForceCommand internal-sftp | |
| AllowTcpForwarding no | |
| close | |
| service ssh restart |
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 | |
| function base32_decode($data) { | |
| $base = array_flip(array_merge(range("A","Z"), range("2", "7"))); | |
| $array = str_split(strtoupper($data)); | |
| $n = 0; | |
| $j = 0; | |
| $binary = ""; |