Skip to content

Instantly share code, notes, and snippets.

View ep4sh's full-sized avatar
👊

Pasha Radchenko ep4sh

👊
View GitHub Profile
sudo yum install epel-release -y && sudo yum install nginx -y && \
sudo sed -i 's/listen .* 80 .*/listen 8080 default_server;/' /etc/nginx/nginx.conf && \
sudo sh -c "echo `curl -s http://169.254.169.254/latest/meta-data/public-ipv4` > /usr/share/nginx/html/index.html" && \
sudo systemctl restart nginx
git config --global alias.lg "log --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(green)(%cr) %C(blue)<%an>%Creset' --graph --color --abbrev-commit"
<?php
// name, damage, durability
$weaponSet1 = [
["Sword", 15, 80],
["Scythe", 35, 10],
["Club", 5, 40],
];
$json = json_encode($weaponSet1);
@ep4sh
ep4sh / index.php
Created October 7, 2018 18:16
datatables-bootstrap4-mysql
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
VCG
</title>
@ep4sh
ep4sh / even.php
Last active September 29, 2018 21:06
test Loftschool php #1
<?php
for ($i=1; $i<=10; $i++) {
if (($i % 2) == 0) {
echo $i." ";
}
}
?>
@ep4sh
ep4sh / gist:a382a7d32f1a4339e3074af7963c2a1e
Last active September 19, 2018 19:31
MongoDB SQL join analog
use app;
db.createCollection('rent')
db.createCollection('guest')
db.guest.insert({ "_id" : ObjectId("5ba24958103b0ac162148f6f"), "name" : "Иванов Иван Иваныч", "floor" : 3, "org" : 2, "cardNo" : 34443, "dateIn" : 20180919, "dateOut" : 20190920 })
db.rent.insert({ "_id" : ObjectId("5ba24a53103b0ac162148f71"), "company" : "Sun", "floor" : 3, "org" : 2 })
db.rent.insert({ "_id" : ObjectId("5ba24a44103b0ac162148f70"), "company" : "Microsoft", "floor" : 2, "org" : 1 })
<!DOCTYPE html>
<html lang="en">
<head>
<title>titile</title>
<meta charset="utf-8">
<style>
@keyframes RX {
from { transform: rotate(0deg);}
to {transform:rotate(10200deg);}
}
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
apply ScheduledDowntime "backup-downtime" to Service {
author = "icingaadmin"
comment = "Scheduled downtime for backup"
ranges = {
monday = service.vars.backup_downtime
tuesday = service.vars.backup_downtime
wednesday = service.vars.backup_downtime
thursday = service.vars.backup_downtime
friday = service.vars.backup_downtime
@ep4sh
ep4sh / gist:5a34cbbf8f2294766027bfa511623c3a
Created June 25, 2018 09:11
Try to loop in icinga with posgtres clusters and databases
apply Service "pg-NOW()-check" {
check_command = "pgsql"
// var db_dict = { "db1" = 5432, "db2" = 5433, "db3" = 5434, "db4" = 5435 }
for (db_key => db_value in db_dict) {
//need to out into host file
vars.pgsql_hostname = host.address
vars.pgsql_database = db_key
vars.pgsql_port = db_value
// monit user & password