Skip to content

Instantly share code, notes, and snippets.

View fossilet's full-sized avatar
🎯

2f38b454 fossilet

🎯
View GitHub Profile
@fossilet
fossilet / a.md
Created April 23, 2024 06:59
wpnonce
function install_plugins_upload() {
	?>
<div class="upload-plugin">
	<p class="install-help"><?php _e( 'If you have a plugin in a .zip format, you may install or update it by uploading it here.' ); ?></p>
	<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo esc_url( self_admin_url( 'update.php?action=upload-plugin' ) ); ?>">
		<?php wp_nonce_field( 'plugin-upload' ); ?>
		<label class="screen-reader-text" for="pluginzip">
			<?php
			/* translators: Hidden accessibility text. */
@fossilet
fossilet / README.md
Last active April 3, 2018 14:22 — forked from quagliero/README.md
Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

This assumes you have brew installed and are comfortable using a terminal.

Following the guide on https://github.com/tpruvot/cpuminer-multi will likely lead to errors about invalid paths to OpenSSL, and neoscrypt errors to the tune of Undefined symbols for architecture x86_64 during the build. I managed to piece together different fixes into an installation that has worked for me. So I hope it works for you.

Requirements

Ensure a c compiler is installed. Type g++ in the terminal and continue with the xcode installation if necessary. If it prints clang: error: no input files, then you can proceed.

@fossilet
fossilet / ldap_proxy.py
Last active December 16, 2016 03:15
LDAP proxy with logs
#! /usr/bin/env python
# encoding: utf8
import sys
from functools import partial
from ldaptor.protocols import pureldap
from ldaptor.protocols.ldap import ldapserver
from ldaptor.protocols.ldap.ldapclient import LDAPClient, \
LDAPClientConnectionLostException
@fossilet
fossilet / supervisord
Last active December 16, 2016 03:19
Supervisor 3 init script for CentOS 6.5. `pip install supervisor` does not contain an init script. This adds one.
#!/bin/sh
#
# From: http://serverfault.com/a/259230/53861
#
# INSTALL:
# sudo cp supervisord /etc/init.d
# sudo chkconfig --add supervisord
# sudo chkconfig supervisord on
# service supervisord start
#
@fossilet
fossilet / rqretryworker.py
Created November 2, 2016 07:48 — forked from spjwebster/rqretryworker.py
A basic rq worker that will retry failed jobs before dumping it in the failed queue.
#!/usr/bin/env python
import os, sys
sys.path.append(os.getcwd())
import logging
import rq
MAX_FAILURES = 3
@fossilet
fossilet / getip.py
Created September 19, 2012 04:02 — forked from zhasm/getip.py
Get the local IP and Public IP
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# author : Rex Zhang
"""Get the local IP and Public IP"""
import re
from subprocess import Popen, PIPE
from threading import Lock
@fossilet
fossilet / imapquota.py
Created September 18, 2012 11:27 — forked from zhasm/imapquota.py
Check the quota and usage of the IMAP server.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''Get quota from IMAP server
'''
import argparse
import getpass
import imaplib
import re