Skip to content

Instantly share code, notes, and snippets.

View axilleas's full-sized avatar
🏠
Working from home

Achilleas Pipinellis axilleas

🏠
Working from home
View GitHub Profile
@jerrac
jerrac / gitlab2elk.yml
Created March 23, 2015 22:19
Logstash and Logstash-Forwarder config for GitLab logs
# YAML config for these Ansible roles:
# https://github.com/LaneCommunityCollege/aspects_logstash
# https://github.com/LaneCommunityCollege/aspects_logstash_forwarder
#
# Since it's just straight config blocks, you should be able to just copy and paste what you need if you don't use
# those Ansible roles.
#
# End result is multiline logs combined into one, and dates are parsed correctly.
aspects_logstash_rules:
@tomazzaman
tomazzaman / README.md
Last active September 17, 2023 20:59
Gulp workflow for WordPress theme development

Gulp workflow for WordPress theme development

Requirements

In order for Livereload to work, you need a Firefox or Chrome extension as Gulp doesn't inset it automatically. Alternatively, you can also manually put the livereload script in footer.php, just make sure to insert it only on development environment:

<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
@Ramblurr
Ramblurr / sudoers-vagrant
Created February 18, 2015 15:35
Vagrant sudo permissions for NFS in Fedora.
## drop this in the new file /etc/sudoers.d/sudoers-vagrant
## add add your user to the vagrant group
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status nfs-server
Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /etc/exports
%vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE
@tfg13
tfg13 / gist:6f18bfcf171bcae59536
Last active April 11, 2016 04:09
Arch Linux: Upgrading to Plasma 5.2

KDE Plasma Workspaces 4 to KDE Plasma 5.2 - Arch Linux

This guide was written on January 29, 2014. Things may change in the future!

  1. System needs to be up to date:pacman -Syu
    This will pull in a lot of Frameworks5 stuff. Also, some applications like konsole are already ported to Plasma 5.

  2. Reboot to make sure you run the latest software.

  3. Check if fonts in Konsole are ugly/wrong. If so, (re-)set font in konsole settings.

@buren
buren / rails_web_console_param.rb
Last active February 13, 2016 18:16
Attach a rails web console to any page by adding ?web_console=
# config/initializers/web_console.rb
WebConsoleBeforeAction = ->(controller) do
controller.console if controller.params[:web_console]
end
ApplicationController.before_action(WebConsoleBeforeAction) if defined?(WebConsole) && Rails.env.development?
# NOTE:
# For security reasons only do this in development.
@benoitzohar
benoitzohar / gitolab.php
Last active September 3, 2017 09:29
Migrate repositories from Gitolite to GitLab.
#!/usr/bin/php -qC
<?php
/******************************************************************************
*
* @file gitolab.php
* @author Benoit Zohar
* @link http://benoitzohar.fr/
* @last-edited 2015-01-09
* @description Migrate projects from Gitolite to GitLab
@bbaaxx
bbaaxx / Vagrantfile
Last active October 21, 2018 11:12
Vagrantfile for a cheap ember-cli box (with NVM)
# -*- mode: ruby -*-
# vi: set ft=ruby :
box = 'ubuntu/trusty64'
hostname = 'emberclibox'
domain = 'example.com'
ip = '192.168.42.42'
ram = '512'
$rootScript = <<SCRIPT
#!/usr/bin/ruby
#
# This scipt is designed to work with mock 1.2.0+
require 'uri'
require 'shellwords'
class Mock
attr_reader :root
@HalosGhost
HalosGhost / static_typing_class.rst
Last active October 19, 2021 15:56
The skeleton / syllabus of a short IRC class on Static Typing

Static Typing

Though dynamic languages have become far more common in recent years (e.g., Python, Lua, PHP, JS, etc.), many static languages are still in-use today and learning how to work with them is invaluable (particularly for fields such as systems programming—where static languages are far more common).

When we say "dynamic typing", what people usually mean is that the programmer does not need to annotate the variable declaration with an explicit type. That is, in Python for example, you simply declare a variable that can hold any type of data. Put another way, in dynamic languages, variables do not have a type even though values might. In most static languages, we do not have this shortcut.

@maxim
maxim / tasks.yml
Created June 26, 2014 21:02
How to recursilvely chmod dirs and files (separately) with Ansible, without always seeing "changed" status.
- name: ensure all dir permissions are set correctly
shell: find /my/dir -type d -print0 | xargs -0 chmod -c 2755
register: chmod_result
changed_when: "chmod_result.stdout != \"\""
- name: ensure all file permissions are set correctly
shell: find /my/dir -type f -print0 | xargs -0 chmod -c 0650
register: chmod_result
changed_when: "chmod_result.stdout != \"\""