Skip to content

Instantly share code, notes, and snippets.

View lucawen's full-sized avatar

Luca Lacerda lucawen

  • Belo Horizonte, MG, Brasil
View GitHub Profile
{
"name": "Run Django",
"type": "python",
"request": "attach",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
],
var Select2Item = (function () {
function formatRepoSelection(item) {
return item.text;
}
function formatRepo(item) {
return item.text;
}
function processData(data) {
import os
import sys
import argparse
try:
import xml.etree.ElementTree as etree
except Exception:
print()
print("lxml , module Not Found")
function FilterByAttribute(mainElementName, itemElementName, attributeName, addSpace){
addSpace = addSpace || false;
var divList = $(itemElementName);
divList.sort(function (a, b) {
var attributeA = $(a).data(attributeName);
var attributeB = $(b).data(attributeName);
if(IsStringNumber(attributeA) || IsStringNumber(attributeB)){
return $(a).data(attributeName) > $(b).data(attributeName);
} else {
return String.prototype.localeCompare.call(attributeA.toLowerCase(), attributeB.toLowerCase());
@lucawen
lucawen / RPi: Syncthing + start on boot
Created January 9, 2016 17:54
How to install Syncthing on Raspberry Pi + start on boot
Create a folder in /opt and cd to it
$ sudo mkdir -p /opt/syncthing
$ cd /opt/syncthing
Get the latest arm version of syncthing from github (https://github.com/syncthing/syncthing/releases/) x marks the version number.
$ sudo wget https://github.com/syncthing/syncthing/releases/download/vx.xx.x/syncthing-linux-arm-vx.xx.x.tar.gz
sudo tar -xzvf syncthing-linux-arm-vx.xx.x.tar.gz
sudo rm syncthing-linux-arm-vx.xx.x.tar.gz
Move content one folder up
# This file should be placed at /etc/logrotate.d/
/srv/*/shared/log/*.log {
daily
missingok
dateext
rotate 30 # amount of days to keep compressed logs (you should backup it up externally)
compress
delaycompress
notifempty