# Written by The Suhu (2021).
# Tested on Oracle 12c
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
# save in your home directory | |
set smtp-use-starttls | |
set ssl-verify=ignore | |
set nss-config-dir=/etc/pki/nssdb | |
set smtp=smtp.yourdomain.com:465 | |
set smtp-auth=login | |
set smtp-auth-user=thesuhu@yourdomain.com | |
set smtp-auth-password=yourpassword | |
set from="thesuhu@yourdomain.com (The Suhu)" |
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
DELIMITER $$ | |
CREATE FUNCTION extract_digits (string_mixed VARCHAR(100)) RETURNS VARCHAR(100) NO SQL | |
BEGIN | |
DECLARE find_digit_position VARCHAR(100); | |
DECLARE string_digits VARCHAR(100) DEFAULT ''; | |
DECLARE search_char VARCHAR(1); | |
DECLARE i INTEGER DEFAULT 1; | |
IF LENGTH(string_mixed) > 0 THEN |
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 | |
# Already tested on Ubuntu 20.04 | |
# Check the latest version at https://curl.se/download/ | |
VERSION=7.80.0 | |
cd ~ | |
sudo apt-get update -y | |
sudo apt-get install -y nghttp2 libnghttp2-dev libssl-dev build-essential wget | |
wget https://curl.haxx.se/download/curl-${VERSION}.tar.gz |
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 | |
# Tested on CentOS 7 and CentOS 8 | |
# Check the latest version at https://curl.se/download/ | |
VERSION=7.80.0 | |
cd ~ | |
sudo yum update -y | |
sudo yum install wget gcc openssl-devel make -y | |
wget https://curl.haxx.se/download/curl-${VERSION}.tar.gz |
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
// You can simply use response.data.pipe and fs.createWriteStream to pipe response to file | |
const axios = require('axios') | |
// Example 1: | |
axios({ | |
method: "get", | |
url: "https://xxx/my.pdf", | |
responseType: "stream" | |
}).then(function (response) { | |
response.data.pipe(fs.createWriteStream("/temp/my.pdf")) |
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
# Make sure MySQL is not running | |
sudo systemctl stop mysql | |
# Then purge all of the MySQL packages | |
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-* | |
# Then delete all of the MySQL files | |
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql | |
# Finally clean all packages that are not needed: |
OlderNewer