Skip to content

Instantly share code, notes, and snippets.

@Jahroots
Jahroots / 1-CustomerCreatedEventSqsConsumer.java
Created January 18, 2023 16:13 — forked from rponte/1-CustomerCreatedEventSqsConsumer.java
Spring Boot: Testing a @SqsListener with TestContainers and LocalStack
package br.com.zup.edu.app2.xxx.samples.aws.sqs;
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.Customer;
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.CustomerRepository;
import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy;
import io.awspring.cloud.messaging.listener.annotation.SqsListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.messaging.handler.annotation.Header;
@Jahroots
Jahroots / config.fish
Created October 12, 2022 08:48 — forked from guilherfp/config.fish
Fish Shell config file
alias unset 'set --erase'
alias rmraf 'rm -rf'
alias faker 'faker-cli --locale pt_BR'
alias clipboard 'copy-paste copy'
alias docker-minikube 'eval (minikube docker-env)'
alias make-all-mine 'sudo chown guilherfp:guilherfp'
alias listen-ports 'sudo lsof -i -P -n | grep LISTEN'
# Java
set -gx JAVA_HOME /home/guilherfp/.sdkman/candidates/java/current
set -gx PATH $JAVA_HOME/bin $PATH
@Jahroots
Jahroots / i3-shortcuts-screenshot.md
Created June 22, 2022 08:09 — forked from dianjuar/i3-shortcuts-screenshot.md
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
Verifying my Blockstack ID is secured with the address 1N9D2oMU41vEdXf59aUmmUL8XXqqSpyxZD https://explorer.blockstack.org/address/1N9D2oMU41vEdXf59aUmmUL8XXqqSpyxZD

Keybase proof

I hereby claim:

  • I am jahroots on github.
  • I am jahroots (https://keybase.io/jahroots) on keybase.
  • I have a public key whose fingerprint is 3B22 B045 A6FE 59A4 1EB1 D2B1 AF14 913B C1D7 79BB

To claim this, I am signing this object:

@Jahroots
Jahroots / conf.nanorc
Created May 2, 2017 12:03 — forked from gilgamesh2k/conf.nanorc
nano syntax highlighting for most configuration files including bashrc, and bash_profile, bash_historysave conf.nanorc under /usr/share/nano/add the following to the end of the file /etc/nanorc:=====================================================## Configuration filesinclude "/usr/share/nano/conf.nanorc"
# config file highlighting
syntax "conf" "bash_profile" "bash_history" "\rc$" "(\.|/|)control$" "(\.(repo|conf|config|cfg|cnf|rc|lst|list|defs|ini|desktop|mime|types|preset|cache|seat|service|htaccess)$|(^|/)(\w*crontab|mirrorlist|group|hosts|passwd|rpc|netconfig|shadow|fstab|inittab|inputrc|protocols|sudoers)$|conf.d/|.config/)"
# default text
color magenta "^.*$"
# special values
icolor brightblue "(^|\s|=)(default|true|false|on|off|yes|no)(\s|$)"
# keys
@Jahroots
Jahroots / patch.txt
Created February 15, 2017 09:42 — forked from toddsby/patch.txt
socket.io and apache reverse proxy fix
I modified the source code of socket.io-client/socket.io.js 1.0.6
line 3387:
return schema + '://' + this.hostname + port + this.path + query;
Changed to:
return schema + '://' + this.hostname + port + this.path + 'ws/' + query;
And my ProxyPass config:
@Jahroots
Jahroots / VpnBook.sh
Created October 4, 2016 20:30
Get Vpnbook username and password
#!/bin/bash
wget -q -O ~/vpnbook.tmp www.vpnbook.com/freevpn
username=$(cat ~/vpnbook.tmp | grep -m 1 Username | sed -e 's/<li>Username: <st
rong>/ /g' | sed -e 's/<\/strong><\/li>/ /g' | xargs)
password=$(cat ~/vpnbook.tmp | grep -m 1 Password | sed -e 's/<li>Password: <st
rong>/ /g' | sed -e 's/<\/strong><\/li>/ /g' | xargs)
echo $username
echo $password
@Jahroots
Jahroots / UnloadPhotoAnalysisd.sh
Created September 29, 2016 23:28
Unload service com.apple.photoanalysisd
#!/bin/bash
launchctl stop com.apple.photoanalysisd
launchctl unload -w /System/Library/LaunchAgents/com.apple.photoanalysisd.plist
@Jahroots
Jahroots / mockTenant.java
Created July 19, 2016 13:27
Mock hybris tenant
// -----------------------------------------------------------------------------------
// This unit test does not add value to the code quality, but to show off how to mock
// PRIVATE and STATIC fields of a class as well as how to mock TENANT in Registry
// -----------------------------------------------------------------------------------
final AbstractTenant mockTenant = Mockito.mock(AbstractTenant.class);
final Field fieldStopping = AbstractTenant.class.getDeclaredField("currentlyStopping");
fieldStopping.setAccessible(true);
ReflectionUtils.setField(fieldStopping, mockTenant, Boolean.TRUE);
final Field field = Registry.class.getDeclaredField("_currentTenant");