Skip to content

Instantly share code, notes, and snippets.

View biggora's full-sized avatar
💭
I may be slow to respond.

Aleksejs Gordejevs biggora

💭
I may be slow to respond.
View GitHub Profile
@biggora
biggora / remove-docker-containers.sh
Created February 12, 2016 18:25
How to remove unused Docker containers and images
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q) # or docker ps -q -a | xargs docker rm
# Delete all images
docker rmi $(docker images -q)
# delete all untagged images
docker rmi $(docker images | grep “^<none>” | awk ‘{print $3}’)
@biggora
biggora / remove_crw.cmd
Created February 10, 2016 20:16 — forked from xvitaly/remove_crw.cmd
Remove telemetry updates for Windows 7 and 8.1
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
start /w wusa.exe /uninstall /kb:3068708 /quiet /norestart
@biggora
biggora / dumps.sh
Last active December 13, 2015 14:52
# Dumping the database structure for all tables with no data
# Dumping the MySQL
mysqldump -d -h localhost -u root -pmypassword databasename > dumpfile.sql
# Dumping the SQlite
sqlite3 databasefile.db .sch > dumpfile.sql
# Dumping the PostgreSQL
pg_dump --schema-only databasename > dumpfile.sql
@biggora
biggora / nginx.conf
Last active August 29, 2015 14:26 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@biggora
biggora / java-cassandra-install.sh
Last active August 29, 2015 14:24
Cassandra install
#!/bin/bash
# To install the latest Oracle Java:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java9-installer
sudo update-java-alternatives -s java-9-oracle
sudo apt-get install oracle-java9-unlimited-jce-policy
# Add the DataStax Community repository to the /etc/apt/sources.list.d/cassandra.sources.list
@biggora
biggora / uploader.js
Created August 17, 2014 08:22
Example uploading files middleware for TrinteJS framework
/**
* Upload manager
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var Uploader = require('express-uploader');
var defaultOptions = {
@biggora
biggora / local.js
Last active January 3, 2016 19:38
Local Authorization in TrinteJS
/**
* Local Authorization manager
*
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var auth = require( 'trinte-auth' );
@biggora
biggora / session.js
Created January 19, 2014 18:21
Add session store in TrinteJS
/**
* Default session configuration
* Inject app and express reference
*
* Created by init script
* App based on TrinteJS MVC framework
* TrinteJS homepage http://www.trintejs.com
**/
var config = require('./configuration');
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
/*
A little node.js server for testing html5 ajax file uploads.
It serves up the current directory and receives uploads at /upload.
This is for use with xhr.send(file) where the entire request body is the file.
It just pauses one second between chunks so that client-side progress events
get a chance to fire. On my laptop it looks like the maximum chunk size is
around 40K, so you would still need images in the range of hundreds of kilobytes
to really be able to test it.