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
# Redis on RedHat 7.2 | |
# To execute: | |
# curl -s 'https://gist.githubusercontent.com/vkhazin/f5c1b6e36e3a6c29aaf882041aaf78cb/raw/76de41b46cbf3749291ae87eef18cb71ce4c4d05/redhat-redis-setup.sh' | sh | |
sudo yum install wget -y | |
wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/e/ | |
sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm | |
sudo yum install redis -y | |
sudo mkdir /etc/redis | |
sudo semanage port -a -p tcp 16379 -t redis_port_t | |
sudo mv /etc/redis.conf /etc/redis.conf.bak |
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/redis.conf | |
# Redis configuration file example. | |
# | |
# Note that in order to read the configuration file, Redis must be | |
# started with the file path as first argument: | |
# | |
# ./redis-server /path/to/redis.conf | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: |
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
# Redis cluster | |
sudo yum install ruby -y | |
gem install redis | |
wget http://download.redis.io/redis-stable/src/redis-trib.rb | |
chmod +x ./redis-trib.rb | |
./redis-trib.rb create 172.31.11.148:6379 172.31.12.11:6379 172.31.10.4:6379 |
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
#!/bin/bash | |
# http://docs.aws.amazon.com/systems-manager/latest/userguide/ssm-agent.html#sysman-install-ssm-agent | |
cd /tmp | |
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm |
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
declare @CustomerID int | |
set @CustomerID = 342 | |
--Original statement | |
select aut.[Token] | |
, aut.[UserName] | |
, aut.[LastAuthenticationTime] | |
, aut.[LoginSourceType] | |
, aut.[AuthenticationRetries] | |
, aut.[MarketName] |
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
# Installing Java | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer -y | |
# Downloading | |
username='[email protected]' | |
curl -O -u $username 'https://downloads.datastax.com/enterprise/DataStaxEnterprise-4.8.9-linux-x64-installer.run' | |
# Installing |
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
# Installing dependencies locally using terminal | |
```pip install module-name -t ./python_modules``` | |
# Referencing locall dependencies in python module: | |
``` | |
import sys | |
sys.path.insert(0, "./python_modules") | |
``` |
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
USE <db name> | |
CREATE LOGIN <login name> WITH PASSWORD = '<password>' | |
create user <login name> for login <login name> | |
exec sp_addrolemember 'db_owner', '<db name>' |
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://blog.sqlauthority.com/2009/01/07/sql-server-find-currently-running-query-t-sql/ | |
SELECT sqltext.TEXT, | |
req.session_id, | |
req.status, | |
req.command, | |
req.cpu_time, | |
req.total_elapsed_time | |
FROM sys.dm_exec_requests req | |
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext |
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
# NginX reverse proxy for jenkins: https://gist.github.com/rdegges/913102 | |
FQDN="ec2-18-222-184-237.us-east-2.compute.amazonaws.com" | |
sudo apt install nginx -y | |
sudo rm /etc/nginx/sites-enabled/default | |
CONFIG="upstream kibana { | |
server $FQDN:5601 fail_timeout=0; | |
} |
OlderNewer