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 | |
if ((isset($_ENV["HTTPS"]) && ("on" == $_ENV["HTTPS"])) | |
|| (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "1") !== false)) | |
|| (isset($_SERVER["HTTP_X_FORWARDED_SSL"]) && (strpos($_SERVER["HTTP_X_FORWARDED_SSL"], "on") !== false)) | |
|| (isset($_SERVER["HTTP_CF_VISITOR"]) && (strpos($_SERVER["HTTP_CF_VISITOR"], "https") !== false)) | |
|| (isset($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_CLOUDFRONT_FORWARDED_PROTO"], "https") !== false)) | |
|| (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && (strpos($_SERVER["HTTP_X_FORWARDED_PROTO"], "https") !== false)) | |
) { | |
$_SERVER["HTTPS"] = "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
# Install kubectx (Switch between Kubernetes contexts/namespaces) | |
sudo curl -sSL https://github.com/ahmetb/kubectx/releases/download/v0.9.1/kubens_v0.9.1_linux_x86_64.tar.gz | sudo tar -C /usr/local/bin -xz | |
# Install kubens (Switch between Kubernetes namespaces) | |
sudo curl -sSL https://github.com/ahmetb/kubectx/releases/download/v0.9.1/kubens_v0.9.1_linux_x86_64.tar.gz | sudo tar -C /usr/local/bin -xz |
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
<? | |
echo "I am running as user="; | |
system("whoami"); | |
echo "<P>I can write here= "; | |
system("pwd"); | |
$fname="write_test.txt"; | |
if (file_exists($fname)) { | |
echo "<P> I found file $fname and will delete it"; | |
unlink($fname); | |
echo "...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
# Log Rotate by initialising logger from the app | |
#Way one | |
# reference : http://ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html#method-c-new | |
# This one from Atinder Singh https://medium.com/@atinders/easy-log-rotation-with-rails-5-7b8d3c173461 | |
# config/environments/production.rb | |
Rails.application.configure do |
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 | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
set -e | |
set -o pipefail | |
FROM="/tmp/FROM/" | |
TO="/tmp/TO/" | |
DATE=$(date '+%d-%m-%Y %H:%M:%S') | |
LOG_FILE=/scripts/rsync-txt-files.log |
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
## | |
## to test: | |
## logrotate -d /etc/logrotate.conf | |
## | |
## to enforce: | |
## logrotate -v -f /etc/logrotate.conf | |
## | |
/data/kafka/log/*.log { | |
daily |
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
<IfModule proxy_ajp_module> | |
ProxyPass "/" "ajp://127.0.0.1:10001/" | |
</IfModule> |
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
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
// See also: http://www.paulund.co.uk/change-url-of-git-repository | |
$ cd $HOME/Code/repo-directory | |
$ git remote rename origin bitbucket | |
$ git remote add origin https://github.com/user/awesome-new-repo.git | |
$ git branch --set-upstream-to=origin/master master | |
$ git push origin master | |
$ git pull origin master --allow-unrelated-histories |
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 | |
LISTA="/opt/sync-mail/list.txt" | |
LISTA_TMP="/tmp/list" | |
HOST_ORIGEM="xxx.xxx.xxx.xxx" | |
HOST_DESTINO="xxx.xxx.xxx.xxx" | |
cat ${LISTA}|grep -v "^#" | sed '/^ *$/d' > ${LISTA_TMP} | |
while IFS=: read usuario nome senha;do |
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
sudo fdisk -l | |
sudo mount /dev/sdax /mnt | |
sudo mount --bind /dev /mnt/dev | |
sudo mount --bind /dev/pts /mnt/dev/pts | |
sudo mount --bind /proc /mnt/proc | |
sudo mount --bind /sys /mnt/sys | |
sudo chroot /mnt |
NewerOlder