Skip to content

Instantly share code, notes, and snippets.

0xDEADBEEF JamesTheHacker

View GitHub Profile
View gist:44d08d3beb9018e30fc84594d529d044
sudo -u "${user}" bash -s <<ILOVEBASH
export WP_CLI_CACHE_DIR=${webroot}
cd ${webroot}
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x ${webroot}/wp-cli.phar
./wp-cli.phar core download
./wp-cli.phar config create --dbname="${db_name}" --dbuser="${db_username}" --dbpass="${db_password}" --dbhost="${db_host}"
View gist:f4f581c10efb6a5572a1cc1cfa33b375
## Example configuration:
# upstream fastcgi_backend {
# # use tcp connection
# # server 127.0.0.1:9000;
# # or socket
# server unix:/var/run/php/php7.0-fpm.sock;
# }
# server {
# listen 80;
# server_name mage.dev;
View www.conf
# TODO: Use calculation to set these sizes
sed -r -i 's/^;?pm ?=.*$/pm = dynamic/' /etc/php/7.2/fpm/pool.d/www.conf
sed -r -i 's/^;?pm.max_children ?=.*$/pm.max_children = 25/' /etc/php/7.2/fpm/pool.d/www.conf
sed -r -i 's/^;?pm.start_servers ?=.*$/pm.start_servers = 10/' /etc/php/7.2/fpm/pool.d/www.conf
sed -r -i 's/^;?pm.min_spare_servers ?=.*$/pm.min_spare_servers = 5/' /etc/php/7.2/fpm/pool.d/www.conf
sed -r -i 's/^;?pm.max_spare_servers ?=.*$/pm.max_spare_servers = 20/' /etc/php/7.2/fpm/pool.d/www.conf
sed -r -i 's/^;?pm.max_requests ?=.*$/pm.max_requests = 500/' /etc/php/7.2/fpm/pool.d/www.conf
View init.vim
call plug#begin('C:\Users\Skrimble\AppData\Local\nvim\plugged')
Plug 'C:\ProgramData\chocolatey\bin\fzf.exe'
Plug 'junegunn/fzf.vim'
Plug 'joshdick/onedark.vim'
Plug 'vim-airline/vim-airline'
Plug 'ryanoasis/vim-devicons'
Plug 'mattn/emmet-vim'
Plug 'takac/vim-hardtime'
call plug#end()
@JamesTheHacker
JamesTheHacker / provision.sh
Created Dec 9, 2019
WIP provision script for magento
View provision.sh
#!/usr/bin/env bash
# Developer: jamie@jr2.co.uk
set -o errexit
set -o pipefail
set -o nounset
export DEBIAN_FRONTEND=noninteractive
mode="developer"
View gist:d70a6d511040ca9db91ac2952d040ced
default: [SUCCESS]: Magento installation complete.
default: [SUCCESS]: Magento Admin URI: /admin_ysf082
default: Nothing to import.
default: Enabled developer mode.
default: <warning>Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html</warning>
View gist:d501a65b23db2db8dc3298bc524c9a18
default: [SUCCESS]: Magento installation complete.
default: [SUCCESS]: Magento Admin URI: /admin_ysf082
default: Nothing to import.
default: Enabled developer mode.
default: <warning>Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html</warning>
View gist:de4bbc2b69c4ea29a65d7f250545acad
# Change permissions for webroot directory
chown "${user}":www-data "${webroot}"
# Create auth.json required for magento installation
sudo -u "${user}" bash -c "mkdir ${home}/.composer"
sudo -u "${user}" bash -c "tee ${home}/.composer/auth.json" > /dev/null <<ILOVEBASH
{
"github-oauth": {
"github.com": "${github_pa_token}"
},
View step3.c
#include <stdio.h>
#include <Windows.h>
/*
* Small utility function to print the values from MEMORY_BASIC_INFORMATION64 struct
*/
void PrintMemoryBasicInformation64(MEMORY_BASIC_INFORMATION64 *mbi)
{
printf("Base Address: %p\n", mbi->BaseAddress);
printf("Allocation Base Address: %p\n", mbi->AllocationBase);
View step2.c
#include <stdio.h>
#include <Windows.h>
int main(int argc, char** argv)
{
int pid = 10964;
DWORD_PTR addr = 0x7FF7BD730000;
/*
* Get a handle for process with specific process id
You can’t perform that action at this time.