Skip to content

Instantly share code, notes, and snippets.

View math3vz's full-sized avatar

Matheus Moraes math3vz

  • São Paulo, Brasil
View GitHub Profile
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@porjo
porjo / dump_route53_records.md
Last active October 1, 2024 14:03
Export route53 records to CSV

Retrieve hosted zones with aws route53 list-hosted-zones then enter the zone Id below:

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/xxxxxxxxxxx" | \
   jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?]  | @tsv'
\ParameterConfigRepository::shouldReceive('findOneByParameterCodeAndPartner')
->once()
->andReturnUsing(function ($code) {
$params = [
'ftp' => '127.0.0.1',
'user' => 'fernandinho',
'password' => '1234'
];
return $params[$code];
@pierophp
pierophp / PS1
Last active April 4, 2017 13:04
PS1='\[\033[0;37m\][\t]\[\033[0;32m\][\u]\[\033[31m\][\h]`git branch 2>/dev/null | grep \* | head -1 | sed "s/\ //g" | awk "{ print \"[ \"\\\$1 \" ]\" }"` \[\033[1;33m\]\w\a\[\033[0m\]\n\$ '
@acodesmith
acodesmith / Products.php
Last active February 9, 2018 16:04
Example of advanced relationships in Yii2
<?php
/**
* @return \yii\db\ActiveQuery
*/
public function getProduct_variants()
{
return $this->hasMany(ProductVariants::className(), ['product_id' => 'id'])->andWhere(['<>','product_variants.status', Statuses::STATUS_REMOVED]);
}
/**
anonymous
anonymous / config.json
Created June 9, 2016 23:14
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#339933",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
git filter-branch --tree-filter 'rm -rf .idea' --prune-empty HEAD
git gc
@pierophp
pierophp / get_total_cpu.sh
Last active September 28, 2016 14:02
Get Total CPU Utilization
top -bn2 | grep "Cpu(s)" | sed -n 2p | sed -e 's/%us//g' | sed -e 's/%sy//g' | awk '{print ($2 + $3)}'
@pierophp
pierophp / clean_local_branchs_git.sh
Created April 18, 2016 16:40
Apaga os branchs locais que já esão no master
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
@nicholasess
nicholasess / README
Last active November 23, 2022 00:30
Desafio Angular
Criar uma aplicação com Angular 1.x, que se comunique com a API do github.
A estrutura tem que se basear no modelo MVC, no uso de rotas para acessar subniveis, exemplo:
Usuario
-> repositorios
-> perfil do repositório
-> organizações
Requisitos: