Skip to content

Instantly share code, notes, and snippets.

@cdolek
cdolek / ddos
Created July 14, 2015 03:42
DDOS check
netstat -anp | grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
@cdolek
cdolek / gist:631e0e32c359efece02f
Last active August 29, 2015 14:24
speedtest from terminal
# via http://binarynature.blogspot.com/2013/03/measure-internet-connection-speed-from-linux-command-line.html
wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py && chmod +x speedtest-cli && ./speedtest-cli
@cdolek
cdolek / gist:d9a795b0eeaf03c62bb4
Last active August 29, 2015 14:23
fix broken homebrew
# PROBLEM ****************************************************************************
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/node.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
######################################################################################
# FIX BELOW -------------------------
cd $(brew --repository)
@cdolek
cdolek / example.com.conf
Last active November 15, 2019 00:25
nginx config example for memcached, php fpm and wordpress
http {
# memcached servers, generated according to wp-ffpc config
upstream memcached-servers {
server 127.0.0.1:11211;
}
# PHP-FPM upstream; change it accordingly to your local config!
upstream php-fpm {
@cdolek
cdolek / SanFrancisco.Neighborhoods.json
Last active January 21, 2025 10:32
San Francisco Neighborhoods GeoJson with Zipcodes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cdolek
cdolek / gist:f8952920e53b3cf6ac57
Created March 10, 2015 22:59
wordpress set proper file and folder permissions
# find all files forward this directory and set 644
sudo find . -type f -exec chmod 644 {} +
# find all directories forward and set 755
sudo find . -type d -exec chmod 755 {} +
@cdolek
cdolek / innodb_to_myisam.sql
Last active August 29, 2015 14:16
convert innodb to myisam - alter table print
SELECT
CONCAT(
'ALTER TABLE ',
TABLE_SCHEMA,
'.',
TABLE_NAME,
' ENGINE = MyISAM;'
)
FROM
information_schema. TABLES
@cdolek
cdolek / gist:372fc6421feffcd39860
Last active March 11, 2020 19:26
Utility for wordpress: Find missing attachment files, non writable upload directories and meta errors
<?php
/**
* Template Name: Attachment Fixing Utility
*/
?>
<html>
<head>
<title>Wordpress Attachments Fixing Utility</title>
<style>
@cdolek
cdolek / gist:4ad30938a88219811f5c
Created February 13, 2015 20:04
Creating folders from 0 to 12 -- zero padded (works on mac os x)
mkdir $(seq -f '%02.0f' 1 12)
creates folders:
01 02 03 04 05 06 07 08 09 10 11 12
@cdolek
cdolek / gist:e791429ae2890b3573d4
Last active October 19, 2015 17:33
exim: useful stuff for managing stuck emails
alias exim_summary="exim -bp | exiqsumm"
alias exim_log="tail -f /var/log/exim4/mainlog"
alias exim_force_send="exiqgrep -i | xargs exim -M"
alias exim_force_send_frozen="exiqgrep -zi | xargs exim -M"
# delete messages from the mail queue by receiver email address
exim -bp|grep "[email protected]"| awk {'print $3'}| xargs exim -Mrm