This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo service udev restart | |
sudo service networking restart | |
sudo service network-manager restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following example shows how to use the gcore utility to force a hung process to dump core, and then shows how the gdb utility can be used to retrieve a stack backtrace from the core file: | |
$ gcore 5649 | |
$ gdb -q /usr/sbin/httpd core.5649 | |
(gdb) backtrace | |
#0 0x0046e7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 | |
#1 0x0063b681 in accept () from /lib/tls/libpthread.so.0 | |
#2 0x00b14814 in apr_socket_accept (new=0xbff85740, sock=0x9671538, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'AC': 'Acre', | |
'AL': 'Alagoas', | |
'AP': 'Amapá', | |
'AM': 'Amazonas', | |
'BA': 'Bahia', | |
'CE': 'Ceará', | |
'DF': 'Distrito Federal', | |
'ES': 'Espírito Santo', | |
'GO': 'Goiás', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Alternative 1: write to file descriptor (not usable) | |
input='testing' | |
pid=1212 | |
echo $input > /proc/$pid/fd/0 | |
## Alternative 2: Pipe fifo to the app | |
fifo_file=/tmp/fifo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
/** | |
* Module to workout CORS requests with CSRF | |
*/ | |
angular.module('CorsCSRF') | |
.config(function($httpProvider) | |
{ | |
// CSRF Interceptor | |
$httpProvider.interceptors.push(function($cookies) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gpu { | |
-webkit-transform: translateZ(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print_r([ | |
exec('woami'), // shell access | |
get_current_user(), // running user | |
file_get_contents('/etc/hosts') // open_basedir restriction | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TestCase extends Laravel\Lumen\Testing\TestCase | |
{ | |
/** | |
* Inject session ID into request, so api can persist on session | |
*/ | |
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WP Admin | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^wp-admin/(.*)$ /site/wp-admin/$1 [QSA,L] | |
RewriteRule ^wp-(.*)$ /site/wp-$1 [QSA,L] | |
</IfModule> | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ApiTest extends TestCase | |
{ | |
public function setUp() | |
{ | |
parent::setUp(); | |
$this->session_id = session()->getId(); |