Skip to content

Instantly share code, notes, and snippets.

View jtviegas's full-sized avatar

joao tiago viegas jtviegas

View GitHub Profile
@jtviegas
jtviegas / basic.cmd
Last active January 15, 2018 12:52
basic windows script
@echo off
setlocal EnableDelayedExpansion
SET p=%~dp0
SET thisdir=%p:~0,-1%
FOR %%a IN ("%thisdir%") DO SET p=%%~dpa
set parentdir=%p:~0,-1%
echo %thisdir%
echo %parentdir%
@jtviegas
jtviegas / windows.txt
Last active January 25, 2018 11:21
windows tricks
# Find Process ID of process that uses a Port
netstat -aon | findstr 8080
# kill the process
Taskkill /PID 26356 /F
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set this_script=%~f0
for %%F in ("%this_script%") do set script_folder=%%~dpF
set pwd=%cd%
if [%1]==[] goto usage
if [%2]==[] goto usage
<?xml version="1.0"?>
<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
custom static analysis rules
</description>
<?xml version="1.0"?>
<ruleset name="Custom Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.net/ruleset_2_0_0.xsd">
<description>
custom static analysis rules
</description>
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.10.0</version>
<executions>
<execution>
<!-- results in target/pmd.xml and target/site/pmd.html -->
// /collection
// get
// 00_get_checkNumberOf_insert_checkNumberOf_delete_checkNumberOf
// post
// 10_post_getObj_checkEquals
// 11_post_not_valid_obj_422
// 12_post_not_existent_collectionId_404 (in case of nested collection)
// 13_post_to_conflic_or_constraint_409 (duplicate, etc...)
// put (upsert)
// 20_put_checkNumberOf_insert_getObj_checkEquals_checkNumberOf
@jtviegas
jtviegas / docker
Last active October 18, 2018 13:35
### run into container
docker run -it <image:version> bash
### attach to container
docker exec -it <image:version> bash

Keybase proof

I hereby claim:

  • I am jtviegas on github.
  • I am jtviegas (https://keybase.io/jtviegas) on keybase.
  • I have a public key ASD7R6ci7rKBnaaCP7FiK2A7etJf89As4GoIYxtbo35kAwo

To claim this, I am signing this object:

# necessary git basic config - avoid unnecessary merges
git config pull.rebase true
# Check ports
# To list the TCP ports that are being listened on, and the name of each listener’s daemon and its PID, run the following command:
sudo netstat -plnt
# download a folder from a github project
svn export https://github.com/jtviegas/terraform-modules/trunk/admin admin