Skip to content

Instantly share code, notes, and snippets.

View clevertechru's full-sized avatar

Vitali M clevertechru

View GitHub Profile
@clevertechru
clevertechru / export-trivy-json-as-csv.txt
Created February 20, 2024 13:33 — forked from julianoborba/export-trivy-json-as-csv.txt
Export Aquasec Trivy JSON report as flat CSV
trivy image --no-progress --light --vuln-type os -f json -o "trivy-report.json" --severity "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL" "foo/bar:latest"
cat trivy-report.json
# OUTPUT:
# {
# "DockerImage": "foo/bar:latest",
# "Results": [
# {
# "Target": "foo/bar:latest (foobar 3.12.1)",
@clevertechru
clevertechru / mgo-ssl.go
Created April 20, 2021 12:36 — forked from kevinadi/mgo-ssl.go
Small example of using MongoDB go driver (mgo) to connect using SSL with client certificate
package main
import (
"fmt"
"log"
"net"
"crypto/tls"
"crypto/x509"
@clevertechru
clevertechru / remove-all-from-docker.sh
Created February 10, 2019 22:14 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
version: '2'
services:
mysql:
image: mysql
volumes:
- .mysql:/var/lib/mysql
# - lowmem.cnf:/etc/mysql/conf.d/lowmem.cnf
environment:
MYSQL_DATABASE: bnsys_production
@clevertechru
clevertechru / wkhtmltopdf@Debian8.sh
Created June 7, 2017 18:23 — forked from fedir/wkhtmltopdf@Debian8.sh
Install wkhtmltopdf on Debian 8
apt-get update
aptitude install xfonts-base xfonts-75dpi fontconfig xvfb
mkdir ~/src/wkhtmltopdf -p
cd ~/src/wkhtmltopdf
wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
dpkg -i wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/local/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+rx /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/sbin/wkhtmltopdf
/usr/local/sbin/wkhtmltopdf https://www.google.fr output.pdf
@clevertechru
clevertechru / memcache.js
Created February 9, 2017 16:00
memcache.js pathed for nodejs 7.0
/**
* Copyright (c) 2011 Tim Eggert
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@clevertechru
clevertechru / XYDataSets.cs
Created July 30, 2016 16:40
Linear Regression in C#/.NET Using Least Squares
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using CommonLib.Geometry;
/*
double[] X = { 75.0, 83, 85, 85, 92, 97, 99 };
@clevertechru
clevertechru / sidekiq.service
Created July 29, 2016 07:52 — forked from brycejohnston/sidekiq.service
Sidekiq systemd service for Debian
#
# systemd unit file for Debian
#
# Put this in /lib/systemd/system
# Run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).
@clevertechru
clevertechru / how_to_install_qcachegrind_on_osx.txt
Last active September 1, 2015 12:53 — forked from justfalter/how_to_install_qcachegrind_on_osx.txt
How to install qcachegrind (kcachegrind) on OSX Snow Leopard
SUMMARY
I like to use kcachegrind for doing profiling on my ruby code. Most of my development
is done on OSX, and while you can install kcachegrind via macports, it takes forever
because it has to build KDE, as well. Much to my surprise, the fine folks who
wrote kcachegrind also made a QT version, qcachegrind. I was able to build this on
OSX without too much effort, only having to install QT and GraphViz. Yippie!
I'm running OSX 10.6.7, with Xcode 4. My default gcc/g++ version is 4.2. I'm sure
it will build just fine on earlier versions of Xcode, but I haven't tested it.
@clevertechru
clevertechru / site.conf
Last active August 29, 2015 14:25 — forked from paskal/site.conf
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null