Skip to content

Instantly share code, notes, and snippets.

View mariusv's full-sized avatar

Marius Voila mariusv

View GitHub Profile
@mariusv
mariusv / remi_epel.yml
Last active February 28, 2024 21:06
Ansible playbook to enable EPEL + REMI repo. Tested on CentOS 6+ and RHEL 7
---
- hosts: all
sudo: yes
tasks:
- name: Install EPEL repo.
yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
state: present
@mariusv
mariusv / syncany.sh
Created June 3, 2011 22:10
backup script and upload via sftp
#!/bin/sh
# Settings
#############################
REMOTEHOST="example.com"
REMOTEBACKUPDIR="backup/sql"
SQLHOST="localhost"
SQLDB="database_name"
SQLUSER="username"
SQLPASS="password"
SQLFILE="database_name.sql"

Keybase proof

I hereby claim:

  • I am mariusv on github.
  • I am mariusv (https://keybase.io/mariusv) on keybase.
  • I have a public key ASCqaSPOQVTDf0CrWWWHfGsE_nSVHBdJJ5pQpxPmuEtmcwo

To claim this, I am signing this object:

@mariusv
mariusv / kops-dns-controller-patch
Created July 4, 2019 18:53
Patch kops DNS controller to `--watch-ingress=true`
Steps for the workaround:
Check the yaml of current deployment for the dns-controller. Here you will find the path to the --watch-ingress setting.
`kubectl get deployment -n kube-system dns-controller -o yaml`
Use the path and make a patch of the deployment. I think the path here will work for most.
```kubectl patch deployment -n kube-system dns-controller --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/command/1", "value":"--watch-ingress=true"}]'```
@mariusv
mariusv / devops_best_practices.md
Created November 19, 2017 12:49 — forked from jpswade/devops_best_practices.md
Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud, open source and business](https://blogs.the451group.com/opensource/2010/03/03/devops-mixing-dev-ops-agile-cloud-open-source-and-busi

@mariusv
mariusv / remove-docker-containers.md
Created November 6, 2017 13:48 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
const request = require('request');
module.exports = function(context, callback) {
var url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22rax%22)%0A%09%09&format=json&diagnostics=true&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=';
var aux = {};
request(url, function (error, response, body) {
if (!error && response.statusCode == 200) {
var info = JSON.parse(body);
# Sends events to Flapjack for notification routing. See http://flapjack.io/
#
# This extension requires Flapjack >= 0.8.7 and Sensu >= 0.13.1
#
# In order for Flapjack to keep its entities up to date, it is necssary to set
# metric to "true" for each check that is using the flapjack handler extension.
#
# Here is an example of what the Sensu configuration for flapjack should
# look like, assuming your Flapjack's redis service is running on the
# same machine as the Sensu server:
#!/bin/bash
# AUTHOR="Marius Voila (marius.voila@gmail.com)";
# TESTED WITH UBUNTU 10.04, 12.04 LTS
#
# Run as root (don't use sudo) with
# ./lampp-wizard.sh ; tail -f /var/log/lampp-wizard.log
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
@mariusv
mariusv / check.sh
Last active December 14, 2015 03:19
Check if your server was compromised with the rootkit which leaves a backdoor on the system and gains the full root access to Linux-based servers.
#!/bin/bash
lib64=/lib64/libkeyutils.so.1.9
lib64_1=/lib64/libkeyutils-1.2.so.2
if [ -f $lib64 ]; then
echo The server is compromised, $lib64 found please open a ticket so we can help you to fix it!!
exit 0
fi