Skip to content

Instantly share code, notes, and snippets.

@phackwer
phackwer / GIT
Last active November 3, 2016 10:25
Estrutura de trabalho do Git:
SUMINDO COM UM COMMIT PUSHADO! SOME ATÉ O HISTÓRICO
git push -f origin shadocommit:nomedabranch
Working dir ==(add)===> Stash ==(commit)==> git local <==(pull)==(push)==> git remoto
Comandos do dia a dia
0 - instalar o build-essential:
sudo apt-get install build-essential
1 - instalar o nodejs e o npm:
sudo apt-get install node;
sudo apt-get install npm;
2 - instalar o gearman:
sudo apt-get install gearman
@phackwer
phackwer / Kill old processes
Created February 15, 2017 18:07
Kill old processes
#!/bin/bash
#######################################################################################
# Author Pablo Sanchez
# RAID Bug Killer - kills $COMMAND processes older then $SECONDS
#######################################################################################
COMMAND='php'
SECONDS=900 # 15 minutes
(ps --noheaders -o pid,etime -C $COMMAND) | while read -r PID TIME; do
SavedIFS="$IFS"
IFS="-:."
@phackwer
phackwer / config.pplist
Last active June 29, 2017 17:21
Clover configuration
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Debug</key>
<false/>
https://blogs.msdn.microsoft.com/microsoft_azure_guide/2014/12/13/how-to-allow-ping-functionality-to-windows-azure-machines/
The Ping functionality on Windows Azure VM is blocked by default for security reasons, to be to enable them you can do that from the Windows firewall advanced features on each VM or you can login on the virtual machine and open the command prompt as an administrator and execute this command.
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" dir=in action=allow enable=yes protocol=icmpv4:8,any
@phackwer
phackwer / Geolocation test
Last active July 18, 2017 09:02
PHP Socket listener
<?php
$listening = true;
$ip = '0.0.0.0';
$port = 9679;
$server = stream_socket_server("tcp://{$ip}:{$port}", $errno, $errstr);
$w = $e
= [];
if (!$server) {
<?php
namespace App\Console;
use Illuminate\Console\Command;
/**
* Class PidLockingCommand
*
* Implements a command with pidlocking control to avoid conflicting processing
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Debug</key>
<false/>
@phackwer
phackwer / gist:a2d56b0824c091509f5555112de785b4
Created November 5, 2017 09:56 — forked from bluefuton/gist:1468061
OS X: replace tabs with spaces in all files using expand
find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done
Follow this steps
https://www.digitalocean.com/community/tutorials/how-to-build-android-apps-with-jenkins
The missing part: accept all licenses
yes | sudo /opt/android-sdk-linux/bin/sdkmanager --licenses