Skip to content

Instantly share code, notes, and snippets.

View ripper2hl's full-sized avatar
🎯
Focusing

Israel Perales ripper2hl

🎯
Focusing
View GitHub Profile
@csamsel
csamsel / Enhanced NGINX logstash parser
Last active February 5, 2022 14:54
Enhanced NGINX logstash parser to include upstream response time and request length fields
Enhanced NGINX logstash parser:
NGINX log format:
log_format enhanced '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent $request_length "$http_referer" "$http_user_agent" $request_time $upstream_response_time';
access_log /var/log/nginx/access.log enhanced;
error_log /var/log/nginx/error.log;
logstash pattern (/opt/logstash/pattern/nginx):
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 28, 2024 16:48
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@balthazar
balthazar / home.controller.js
Last active August 29, 2015 14:14
Bangular socket usage example
angular.module('test')
.controller('HomeCtrl', function ($scope, $http, Socket) {
var vm = this;
vm.items = [];
vm.lastMsg = '';
$http.get('/api/items').success(function (res) {
vm.items = res;
@juanghurtado
juanghurtado / practical-git.md
Last active June 30, 2022 09:54
Git práctico

Git práctico

Conceptos clave

Antes de empezar a soltar comandos como un bellaco, hay que explicar los conceptos clave que se necesitan conocer para trabajar con Git.

Comenzaremos con los diferentes estadios en los que puede encontrarse nuestro código (nuestros cambios sobre el contenido de los ficheros, en realidad).

  1. Workspace: Es el estado real de nuestros ficheros. Tal y como los vemos en nuestro editor.
  2. Stage: Aquí se encuentran los cambios sobre nuestros ficheros que se incluirán en el próximo commit. Cuando hacemos un git add, un git rm o un git mv, estamos introduciendo cambios en el stage, indicándole a Git que en el próximo commit esos cambios irán incluidos.
@mojavelinux
mojavelinux / atom-fedora-20.adoc
Last active September 26, 2022 18:21
Instructions for building and launching the Atom text editor on Fedora 20.

Using Atom on Fedora 20

This guide walks you through the steps of building and launching the Atom text editor on Fedora 20.

Building Atom

  1. Install prerequisite packages

@leszekgruchala
leszekgruchala / dwrPromise.js
Last active November 18, 2015 01:07
DWR request wrapped by Promise
/**
* Creates promise object for DWR async calls.
* @param dwrFunc DWR function to be invoked
* @param arrayOfParameters [optional] parameters of given DWR function
* @returns {Q.promise}
*/
function qDwr(dwrFunc, arrayOfParameters) {
var deferred = Q.defer();
if (arrayOfParameters === undefined || arrayOfParameters === null) {
arrayOfParameters = [];
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@kezzbracey
kezzbracey / gist:6758471
Created September 30, 2013 01:56
Aligning images in markdown / Ghost post editor.
<!--To center an image-->
<p align="center">
![alt]()
</p>
<!--To right align an image-->
<p align="right">
![alt]()
</p>