Skip to content

Instantly share code, notes, and snippets.

'use strict';
const aws = require('aws-sdk');
const s3 = new aws.S3({ apiVersion: '2006-03-01' });
exports.handler = (event, context, callback) => {
const key = decodeURIComponent(event.Records[0].s3.object.key);
const meta = key.split('/');
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@tuapuikia
tuapuikia / get_aws_billing.rb
Created April 3, 2018 07:07 — forked from naga41/get_aws_billing.rb
Script for registering aws billing data to zabbix
!/usr/bin/env ruby
require 'aws-sdk'
@cw_client = AWS::CloudWatch.new(
:access_key_id => "YOUR_ACCESS_KEY"
:secret_access_key => "YOUR_SECRET_KEY",
:cloud_watch_endpoint => 'monitoring.us-east-1.amazonaws.com',
).client
def get_billing(dimentions)
@tuapuikia
tuapuikia / aws-sqs.policy
Created February 22, 2020 10:56 — forked from marcelog/aws-sqs.policy
SQS Policy to allow an S3 bucket to publish messages
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
@tuapuikia
tuapuikia / docker-aliases.sh
Created October 21, 2020 05:34 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@tuapuikia
tuapuikia / php_error_logstash.conf
Created November 27, 2020 07:49 — forked from gerardorochin/php_error_logstash.conf
php error logging into logstash + elasticsearch and trace errors on single line and root path hidden
input {
file {
type => "php-error"
path => "/var/www/error_log"
sincedb_path => "/opt/logstash/sincedb-access"
}
}
@tuapuikia
tuapuikia / php-error-logstash.conf
Created November 27, 2020 07:50 — forked from kamermans/php-error-logstash.conf
Logstash parser for PHP's error_log to combine multline stack traces / errors into one event
input {
stdin {
codec => multiline {
pattern => "^\[%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME} %{TZ}\]"
negate => true
what => "previous"
auto_flush_interval => 10
}
type => "php-error"
}

Setting up Conky on Ubuntu 16.04LTS for the Clevo P751DM2-G

System Information:

We extract this with inxi:

installation:

sudo apt-get install inxi
@tuapuikia
tuapuikia / mirroring-ubuntu-ESM-repo.md
Created March 2, 2022 02:51 — forked from fluential/mirroring-ubuntu-ESM-repo.md
How to mirror ubuntu ESM protected repository

Via https://ubuntu.com/esm#faq

"We're mirroring the repository on our internal Landscape server. Can we still get Ubuntu ESM if using Landscape? ESM is just a regular Ubuntu archive, but authenticated and served over HTTPS. Archive mirroring is already available in Landscape and is the only supported mechanism for mirroring the ESM archive."

TL;DR

It seems its just possible to use URI with login:pass

curl localhost:9200/_search -d '{
"query" : {
"filtered" : {
"query" : {"match_all" : {}},
"filter" : {
"and" : [
{
"range" : {
"file_size" : {"from" : 10, "to" : 10000}
}