Skip to content

Instantly share code, notes, and snippets.

View likewhoa's full-sized avatar

likewhoa likewhoa

View GitHub Profile
@likewhoa
likewhoa / ecatalyst.sh
Created April 27, 2014 01:58
A script that allows you to chroot into a failed catalyst environment to fix errors manually.
#!/bin/bash
# Help menu
print_help() {
cat <<-HELP
Arguments:
--spec - --spec=stage1.spec (default)
--config - --config=/etc/catalyst.conf (default)
@webchick
webchick / gist:956a2d7a49c7490fefb5
Last active December 3, 2019 09:25
Most popular D7 modules (as of July 16, 2015)
SELECT n.title, SUM(w.count) as total
FROM project_usage_week_release w
INNER JOIN field_data_field_release_project r ON w.nid = r.entity_id
INNER JOIN node n ON n.nid = r.field_release_project_target_id
INNER JOIN
field_data_field_release_version v ON v.entity_id = r.entity_id
WHERE LEFT(v.field_release_version_value, 3) = '7.x'
AND FROM_UNIXTIME(w.timestamp) BETWEEN CURDATE()-INTERVAL 2 WEEK AND CURDATE()
GROUP BY n.title
ORDER BY total DESC;
@v0lkan
v0lkan / nginx.conf
Last active July 12, 2024 08:28
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@LaurentMT
LaurentMT / gist:e758767ca4038ac40aaf
Last active April 29, 2024 07:45
Bitcoin Transactions & Privacy (part 1)
This document is an attempt to define metrics quantifying the degree of privacy provided by a bitcoin transaction.
Objectives
Definition of metrics measuring the resistance of a transaction to a set of attacks against users privacy.
Attacks considered in the scope of these metrics are:
- Merged Inputs Heuristic: methods identifying the inputs controlled by a same entity
- Coinjoin Sudoku: methods identifying the links existing between the inputs and outputs of a transaction
@ozen
ozen / Selenium PhantomJS Python Header.py
Last active September 6, 2021 05:12
How to set request headers when using Selenium Python with PhantomJS driver
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
desired_capabilities = DesiredCapabilities.PHANTOMJS.copy()
desired_capabilities['phantomjs.page.customHeaders.User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) ' \
'AppleWebKit/537.36 (KHTML, like Gecko) ' \
'Chrome/39.0.2171.95 Safari/537.36'
driver = webdriver.PhantomJS(desired_capabilities=desired_capabilities)
@nix1947
nix1947 / dynamic rows loading
Created February 11, 2017 03:45
dynamically populating rows and columns of bootstrap in django template
<div class="container">
{% for project in projects %}
{% if forloop.counter0|divisibleby:3 %} <div class="row text-center"> {% endif %}
<div class="col-md-4" onclick="window.location.href='{% url 'club:robotics_detail' project.id %}'" style="cursor: pointer">
<div class="card">
<img src="http://placehold.it/300X150" alt="">
<div class="card-content">
<br>
<h4>Project {{ forloop.counter }}</h4>
<hr>