Skip to content

Instantly share code, notes, and snippets.

View podolinek's full-sized avatar

Ondrej Podolinský podolinek

View GitHub Profile
@rampfox
rampfox / Chromium-at-startup.md
Last active May 6, 2024 14:27
How to open Chromium in full screen at startup on the Raspberry Pi

First, it seems that ~/.config/lxsession/LXDE-pi/autostart does not exist by default.

  1. copy the autostart
cp /etc/xdg/lxsession/LXDE-pi/autostart ~/.config/lxsession/LXDE-pi/
@nrollr
nrollr / ApacheHTTPSConfig.md
Last active March 11, 2024 13:32
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@fprochazka
fprochazka / sqlSelect.php
Created November 30, 2015 22:16 — forked from xbukovsk-zz/sqlSelect.php
sql select
<? php
public static function getAllIndicatorValuesOverview($userId = null) {
$surveys = self::getConnection()->query(
'SELECT surveys.surveyId,surveys.year,user.organizationName
FROM surveys
LEFT JOIN user ON surveys.userId=user.userId'
)->fetchAll();
foreach($surveys as &$survey) {
@milo
milo / post-merge
Created July 23, 2015 11:48
Git hook for purging cache
#!/bin/sh
# Save as .git/hooks/post-merge
# Set execute bit like: chmod ug+x .git/hooks/post-merge
purgePath="temp/cache"
echo
echo -n "HOOK [Purge cache]: "
if [ -d "$purgePath" ]; then
<?php
require 'nette.phar';
//Tracy\Debugger::enable();
$dns = "mysql:host=localhost;dbname=database";
$user = "user";
$password = "*****";
error_log syslog:server=unix:/var/log/nginx.sock;
http {
log_format verbose '$remote_addr - $remote_user $host "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
map $status $loggable {
~^[2] 0;
default 1;
}
@fprochazka
fprochazka / .1 readme.md
Last active October 27, 2018 16:15
.git/hooks/post-checkout

post checkout hook na mazání cache

  • post-checkout.sh uložit jako .git/hooks/post-checkout
  • .invalidate-opcache.php jako www/.invalidate-opcache.php (POZOR! - tenhle soubor buďto na produkci nenahrávat, nebo zablokovat přístup!)
@adityamukho
adityamukho / User.js
Last active November 11, 2021 21:41
Passport authentication for Sails.js 0.9.x
/**
* api/models/User.js
*
* The user model contains the instance method for validating the password.
*/
var bcrypt = require('bcrypt');
function hashPassword(values, next) {
bcrypt.hash(values.password, 10, function(err, hash) {
@mystix
mystix / install-elasticsearch-debian
Last active March 19, 2023 15:14 — forked from karussell/install-elasticsearch-debian
Install ElasticSearch on Debian
VERSION=0.20.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$VERSION.deb
sudo dpkg -i elasticsearch-$VERSION.deb
# be sure you add "action.disable_delete_all_indices" : true to the config!!
@podolinek
podolinek / gist:3900311
Created October 16, 2012 16:16 — forked from pulkitsinghal/gist:1932711
Ramping Up on ElasticSearch Query DSL
// 1) Lets start with the simplest query that you can run in
// the head plugin for ElasticSearch located at the url:
// http://localhost:9200/_plugin/head/
{
"query": {
"match_all": {}
}
}
// 2) Before jumping into forming queries with the ES Query DSL