This file contains 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
use actix_web::{web, App, HttpResponse, HttpServer}; | |
fn is_prime(n: u64) -> bool { | |
if n <= 1 { | |
return false; | |
} | |
for i in 2..=(n as f64).sqrt() as u64 { | |
if n % i == 0 { | |
return false; | |
} |
This file contains 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 | |
# 0. Get iDRAC command-line tools | |
# (we use Dell EMC iDRAC Tools for Linux, v9.3.1) | |
# (for reference, use this link: https://dl.dell.com/FOLDER05818335M/1/DellEMC-iDRACTools-Web-LX-9.3.1-3669_A00.tar.gz) | |
# 1. extract & install tools (install script is USELESS/root privilege is required) | |
tar -xf DellEMC-iDRACTools-Web-LX-*.tar.gz | |
yum install iDRACTools/racadm/RHEL7/x86_64/srvadmin-*.rpm | |
alternatives --install /usr/sbin/racadm racadm /opt/dell/srvadmin/sbin/racadm 1 |
This file contains 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 | |
$ip = '2001:0df0:021f:0000:0000:0000:0000:0000'; | |
$cidrnet = '2001:df0:21f::/48'; | |
function inet_to_bits($inet) | |
{ | |
$splitted = str_split($inet); | |
$binaryip = ''; | |
foreach ($splitted as $char) { |
This file contains 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 | |
echo "input : 103.10.145.3/24 <br>"; | |
function cidrToRange($cidr) { | |
$range = array(); | |
$cidr = explode('/', $cidr); | |
$range[0] = long2ip((ip2long($cidr[0])) & ((-1 << (32 - (int)$cidr[1])))); | |
$range[1] = long2ip((ip2long($range[0])) + pow(2, (32 - (int)$cidr[1])) - 1); | |
return $range; |
This file contains 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
bash hst-install.sh -n yes -w yes -t no -c no -x yes -z yes -b yes -i yes -m yes -s yourhostname.com -e [email protected] -p yourpassword -a no -k no -o yes |
This file contains 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
Options +FollowSymLinks -Indexes | |
IndexIgnore * | |
DirectoryIndex | |
<IfModule mod_rewrite.c> | |
RewriteEngine on |
This file contains 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 | |
/** | |
* [getMediaByUsername description] | |
* | |
* Author : Imam Ali Mustofa - Betta Dev Indonesia | |
* Website : www.bettadevindonesia.com | |
* | |
* This function will scrap data from instagram without API | |
* Define username you need and define how many media will you get! |
This file contains 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
# currently vesta doesnt include mariadb 10.2 and http2, which is for http2 is already ready here https://github.com/serghey-rodin/vesta/pull/1114 | |
#/bin sh | |
clear | |
echo ' __ ______ ______ ____ ____ ____ ____ ______' | |
echo ' / / / ____/ /_ __/ / __ \ / __ \ / __ ) / _/ /_ __/' | |
echo ' __ / / / __/ / / / / / / / /_/ / / __ | / / / / ' | |
echo ' / /_/ / / /___ / / / /_/ / / _, _/ / /_/ / _/ / / / ' | |
echo ' \____/ /_____/ /_/ \____/ /_/ |_| /_____/ /___/ /_/ ' | |
echo -e "\n\n" |