- Make sure the domain you picked points at the IP of your Redash server.
- Switch to the
root
user (sudo su
). - Create a folder named
nginx
in/opt/redash
. - Create in the nginx folder two additional folders:
certs
andcerts-data
. - Create the file
/opt/redash/nginx/nginx.conf
and place the following in it: (replaceexample.redashapp.com
with your domain name)upstream redash { server redash:5000; }
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
package main | |
import ( | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { | |
// Parse the target URL |
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 | |
# Update the local repository and prune remote-tracking branches | |
git fetch --prune | |
# Loop over each local branch and check if it has a remote tracking branch | |
for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do | |
echo "Deleting local branch: $branch" | |
git branch -d "$branch" | |
done |
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 | |
/** | |
* Maldives Payment Gateway Integration | |
* @author haris | |
*/ | |
class MPG | |
{ | |
private $version; |
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 8.1 | |
sudo apt install software-properties-common | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get -y install php8.1-cli | |
# Composer | |
cd ~ | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php composer-setup.php | |
sudo mv composer.phar /usr/local/bin/composer |
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
server { | |
listen 80; | |
root /var/www/cms/public; | |
index index.php index.html index.htm; | |
charset utf-8; | |
location / { | |
try_files $uri $uri/ /index.php?$args; |
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
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
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 | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
wget $line | |
done < "$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
package javaapplication1; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.regex.Matcher; |
NewerOlder