Skip to content

Instantly share code, notes, and snippets.

View j0eii's full-sized avatar
🎯
Focusing

- j0eii

🎯
Focusing
View GitHub Profile
@VladSem
VladSem / tmux2_raspberry.sh
Created May 23, 2015 05:43
install tmux 2.0 on Raspberry Pi (Debian 7.8) Raspbian Wheezy
#!/bin/bash
wget "https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
tar -xf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure
make
make verify
sudo make install
sudo ldconfig
@carlosjgp
carlosjgp / Dockerfile-1
Created April 30, 2019 11:32
Docker file ownership issue
FROM busybox
ARG PUID=1000
ARG PGID=1000
RUN addgroup -g ${PGID} abc && \
adduser -D -u ${PUID} -G abc abc
USER abc
@UnderlineWords
UnderlineWords / pagination-advanced.blade.php
Last active January 7, 2020 07:36
Custom Laravel Pagination for Semantic UI - Laravel Documentation https://laravel.com/docs/master/pagination
<?php
/**
* Semantic UI
* Includes previous and next buttons
* @example $pages->links('pagination-advanced', ['paginator' => $pages])
* @example @include('pagination-advanced', ['paginator' => $pages])
*
* @link https://semantic-ui.com/collections/menu.html#inverted Inverted styles
* @see <div class="ui pagination inverted blue menu"> Inverted blue menu
**/
@ankitnetwork18
ankitnetwork18 / gist:4508704
Created January 11, 2013 07:29
wordpress: add custom fields to post editor
/*
Plugin Name: Patti
Description: Modify Wordpress Add New Post for Adding Patti Data
Version: 1.0
Author: Ankit Agrawal
*/
/****************************************************************************/
/************************* ADD PATTI CUSTOM FIELDS *************************/
add_action( 'admin_init', 'patti_admin' );
@noplanman
noplanman / upgrade-nghttp2
Last active November 17, 2020 23:50
Upgrade nghttp2 for brew with a fix for older MacOS versions
#!/usr/bin/env bash
# Update brew repo.
printf "%s" "Updating brew repo..."
brew update &> /dev/null
echo "✅"
# Get the currently installed and new version of nghttp2.
printf "%s" "Fetch installed and stable nghttp2 versions..."
VERSION_INSTALLED="$(brew list --versions | grep nghttp2 | awk '{print $2}')"
@decidedlygray
decidedlygray / kali_docker_install.sh
Created September 2, 2018 20:30
Docker install script for Kali Rolling
#!/bin/bash
#
# Kali Docker Setup Script
# @decidedlygray 20180902
# LICENSE: MIT
#
# Steps taken from: https://docs.docker.com/install/linux/docker-ce/debian/
# And: https://medium.com/@airman604/installing-docker-in-kali-linux-2017-1-fbaa4d1447fe
# Install uses the repository, so we can get updates in the future
@stavrossk
stavrossk / PHP Real client IP address retriever.php
Last active June 7, 2021 06:05
PHP Snippet: Get Real IP Address of Client: This function will fetch the real IP address of the user even if he is behind a proxy server.
<?php
function getRealIpAddr()
{
if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) )
{
@stagas
stagas / how-to-run-apache-and-node.js-together-the-right-way.markdown
Created December 24, 2010 14:45
How to run Apache and Node.js together (the right way)

Step 1

Get a VPS that offers 2 or more IP addresses.

Step 2

From the WHM cPanel, find the menu item Service Configuration, select Apache Configuration and then click on Reserved IPs Editor.

Step 3

@scribu
scribu / test.php
Created February 8, 2013 03:12
Simulate threads in PHP using only proc_open() and co.
<?php
include __DIR__ . '/threads.php';
$commands = array();
for ( $i=0; $i<10; $i++ ) {
$commands[] = "bash -c 'sleep `shuf -i 1-5 -n 1`; echo $i'";
}
@fideloper
fideloper / usevm.md
Created June 6, 2012 02:24
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!