Skip to content

Instantly share code, notes, and snippets.

View saviour123's full-sized avatar

Saviour Gidi saviour123

View GitHub Profile
@lakshmantgld
lakshmantgld / slackWebhook.md
Last active February 7, 2024 03:57
Configuring slack webhook

A Webhook, in simple terms, is a user-defined HTTP callback. It is a mechanism for the system to notify you about an event. In our case, we need to send messages to a particular channel in slack. Slack calls in Incoming Webhook. It is a mechanism to send messages to your Slack Channel from external sources. These external sources could be any application or service that is capable of sending a JSON payload over HTTP into a Slack Channel. Each Channel will be identified by a unique Incoming Webhook URL to which you can post the message from outside. This configuration is done via the Integrations for your channel.

Steps to create a incoming webhook in Slack:

  1. Naviagte to the Incoming Webhook URL. Click the hyper link incoming webhook integration below the heading Incoming Webhooks.
  2. You will be asked to enter your team URL, followed by your slack credentials.
  3. Once you have completed the above step, you will see the wizard kind of webpage to
@Chengings
Chengings / .editorconfig
Last active April 18, 2024 11:30
Cheatsheets
trim_trailing_whitespace = true
@ruanbekker
ruanbekker / python_mailer_smtplib.py
Created July 26, 2017 15:25
Python SMTP Mailer using Amazon SES (smtplib)
import sys
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
name = "Ruan"
from_address = "no-reply@mydomain.com"
to_address = "ruan@mydomain.com"
subject = "Test"
@johnstanfield
johnstanfield / agent.conf
Last active August 1, 2023 03:33
Configuration to make OSSEC HIDS watch fail2ban.log and alert on fail2ban actions
<!-- add this to /var/ossec/etc/shared/agent.conf -->
<localfile>
<log_format>syslog</log_format>
<location>/var/log/fail2ban.log</location>
</localfile>
const makeRequest = async () => {
const value1 = await promise1()
const value2 = await promise2(value1)
return promise3(value1, value2)
}
@devigned
devigned / nginx.conf
Created February 15, 2017 17:30
Nginx config for Rails puma
upstream puma {
server unix:///home/deploy/apps/level0/shared/tmp/sockets/level0-puma.sock;
}
server {
listen 80 default_server deferred;
# server_name example.com;
root /home/deploy/apps/level0/current/public;
access_log /home/deploy/apps/level0/current/log/nginx.access.log;
# wget https://gist.githubusercontent.com/waja/d9e176f712ae6a6e4442486df80a13ba/raw/deploy_unattended-upgrades.sh -O /tmp/a && sh /tmp/a
apt-get -y install unattended-upgrades needrestart && \
cat > /etc/apt/apt.conf.d/10periodic <<EOF
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
EOF
sed -i 's#// "o=Debian,n=jessie"# "o=Debian,n=jessie"#' /etc/apt/apt.conf.d/50unattended-upgrades && \
sed -i 's#// "o=Debian,n=jessie-updates"# "o=Debian,n=jessie-updates"#' /etc/apt/apt.conf.d/50unattended-upgrades && \
@chmouel
chmouel / nginx-ssl-configuration.conf
Created September 19, 2016 05:54
nginx-ssl-proxy-pass-configuration
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name blog.chmouel.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/blog.chmouel.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/blog.chmouel.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@travisjeffery
travisjeffery / influxdb-setup.md
Last active March 17, 2024 15:38
Guide to setting up InfluxData's TICK stack

Guide to setting up InfluxData's TICK stack

InfluxData's T.I.C.K. stack is made up from the following components:

Component Role
Telegraf Data collector
InfluxDB Stores data
Chronograf Visualizer
@saviour123
saviour123 / script.sh
Last active April 8, 2021 09:13
DB_Scripts
### MONGO
db.createUser({user: "mongo-admin", pwd: "password", roles:[{role: "root", db: "admin"}]})
mongo -u dsals -p --authenticationDatabase dbname
### Create MYSWL User and grant the user ready only.
create user 'username'@'%' identified by ‘password‘;
grant select, show view on database_name.* to 'username'@'%' identified by 'password';