Skip to content

Instantly share code, notes, and snippets.

@minimedj
minimedj / Guide.md
Created October 6, 2021 11:19 — forked from symdesign/Guide.md

Install LAMP

Configure PHP/MySQL for Froxlor

Change the MySQL root password

use mysql;
update user set authentication_string=PASSWORD("PASSWORD!") where User='root';
flush privileges;
@minimedj
minimedj / uwgi-medium-post.ini
Created March 3, 2021 15:07 — forked from sumitsk20/uwgi-medium-post.ini
uwsgi configuration with most commonly sused options for highly scalable website (medium blog post)
[uwsgi]
# telling user to execute file
uid = bunny
# telling group to execute file
gid = webapps
# name of project you during "django-admin startproject <name>"
project_name = updateMe
@minimedj
minimedj / functions_custom-cols.php
Created January 30, 2021 18:53 — forked from morgyface/functions_custom-cols.php
WordPress | Advanced Custom Fields | Create custom columns within admin for a custom post type using ACF
<?php
// Change the columns for the releases list screen
function change_columns( $cols ) {
$cols = array(
'cb' => '<input type="checkbox" />',
'featimg' => 'Featured Image',
'excerpt' => 'Excerpt?',
'title' => 'Title',
'artist' => 'Artist',
'catno' => 'Cat#',
@minimedj
minimedj / creating_keys.md
Created October 5, 2017 07:04
Using OpenSSL to create keys for Mac OS X.

Creating Keys

This is a brief guide to creating a public/private key pair that can be used for OpenSSL. While the "easy" version will work, I find it convenient to generate a single PEM bundle and then export the private/public key from that as needed. This document also covers how to add and remove a password from your private key and how to make sure that keychain will automatically unlock it when you sign in.

Just make it work

Generate an ssh key-pair:

@minimedj
minimedj / postgres_queries_and_commands.sql
Created April 4, 2017 14:38 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
# basic pfctl control
# ==
# Related: http://www.OpenBSD.org
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.
@minimedj
minimedj / gist:cd85641cd7f7af1fd250
Created March 8, 2016 11:00 — forked from gerjantd/gist:9787489
Bash/nc: netcat as a simple telnet server
CLIENT/SERVER MODEL
It is quite simple to build a very basic client/server model using nc. On one console, start nc listening on a specific port for a connection. For example:
$ nc -l 1234
nc is now listening on port 1234 for a connection. On a second console (or a second machine), connect to the machine and port being listened on:
$ nc 127.0.0.1 1234
There should now be a connection between the ports. Anything typed at the second console will be concatenated to the first, and vice-versa. After the connection has been set up, nc does not really care which side is being used as a ‘server’ and which
@minimedj
minimedj / web-servers.md
Created January 27, 2016 14:05 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
// @requires https://gist.github.com/uhunkler/5465857
var text = 'to clipboard ' + new Date(),
returnedtext = '';
clipboard.set( text );
returnedtext = clipboard.get();
test.assert( text === returnedtext, 'Text correctly copied and read to/from the clipboard' );
test.show();
@minimedj
minimedj / snow.c
Last active December 23, 2015 17:59 — forked from MaratB/снег
#include <graphics.h>
#include <conio.h>
#include <stdlib.h>
int random (int N) {
return rand() % N;
}
main() {
int x, y, R, G, B;