Skip to content

Instantly share code, notes, and snippets.

View saulovenancio's full-sized avatar

Saulo Venancio saulovenancio

View GitHub Profile
@saulovenancio
saulovenancio / gist:6188455
Created August 8, 2013 20:36
install smartgit ubuntu based distros
sudo add-apt-repository ppa:eugenesan/ppa
sudo apt-get update
sudo apt-get install smartgit
@saulovenancio
saulovenancio / gist:6188459
Created August 8, 2013 20:36
muda prioridade de app no linux
renice [-n] priority [[-p] pid ...] [[-g] pgrp ...] [[-u] user ...]
@saulovenancio
saulovenancio / gist:6221745
Created August 13, 2013 14:37
find file and deelte.
Find all files having .bak (*.bak) extension in the current directory and remove them:
$ find . -type f -name "*.bak" -exec rm -f {} \;
Find all core files in the / (root) directory and remove them (be careful with this command):
# find / -name core -exec rm -f {} \;
Find all *.bak files in the current directory and removes them with confirmation from user:
$ find . -type f -name "*.bak" -exec rm -i {} \;
@saulovenancio
saulovenancio / gist:6541933
Created September 12, 2013 18:33
hibernate mysql and jpa and c3po persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="<PERSISTENCE UNIT NAME>">
<properties>
<!--
@saulovenancio
saulovenancio / gist:6763286
Created September 30, 2013 12:45
force kill windows app
taskkill /PID /F 9999
@saulovenancio
saulovenancio / gist:6814894
Created October 3, 2013 18:44
update time online in linux
ntpdate pool.ntp.org
0 4 * * * /usr/sbin/ntpdate pool.ntp.org
@saulovenancio
saulovenancio / gist:6919365
Created October 10, 2013 14:32
iterate all files and subfolders in java
import java.io.File;
public class DirectoryReader {
static int spc_count=-1;
static void Process(File aFile) {
spc_count++;
String spcs = "";
for (int i = 0; i < spc_count; i++)
<%@Application Language='C#' Inherits="Website.Global" CodeBehind="Global.asax.cs" %>
(function(){
var re = /(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)|localhost/;
if(re.test(window.location.hostname)) return;
var _gaq=[['_setAccount','UA-23156659-1'],['_trackPageview'],['_trackPageLoadTime']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
})();
# remove from CRX all files deleted from file system
$ vlt st | grep ! | cut -c 2- | xargs -I {} vlt rm {}
# add to CRX all files not yet in vlt control
$ vlt st | grep \? | cut -c 2- | xargs -I {} vlt add {}
# add all missing files into the CRX
vlt st | grep ^A | cut -c 2- | xargs -I {} vlt commit --force {}
# copy all modified files into the CRX