This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STREAM_SRC=https://raw.github.com/gregs1104/stream-scaling/master/stream-scaling | |
SCRATCH=/tmp/memory-test | |
mkdir /tmp/memory-test 2> /dev/null | |
if [[ "$1X" == "X" ]]; then | |
MINMEMORY=29000 | |
else | |
MINMEMORY=$1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 3 -wholename "*/snapshot*/*" -type d -mtime +3 -print -exec rm -rf {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
CREATE TEMPORARY TABLE object_display_order_album_ids ( album_id INTEGER ) ON COMMIT DROP; | |
INSERT INTO object_display_order_album_ids | |
SELECT DISTINCT(id) | |
FROM | |
( | |
SELECT UNNEST(object_display_order.display_order_object_id) AS id | |
FROM object_display_order | |
WHERE object_display_order.display_order_object_type IN ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for box in `cat serverlist | awk '{ print $1 }' | pcregrep 'app|utility|batch'`; do | |
echo "**** $box ***"; | |
ssh $box 'sudo /etc/init.d/httpd stop && sudo umount /huddler/image001 && sudo mount -t nfs image002:/huddler/image002 /huddler/image001 && sudo /etc/init.d/httpd start'; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for box in `cat serverlist | awk '{ print $1 }' | pcregrep 'app|utility|batch' | sed "s/.huddler.com//g"`; do | |
echo "**** $box ***"; | |
ssh $box 'sudo sed -i "/10.36.176.90:\/huddler\/image001/d" /etc/fstab'; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f \( -not -regex '.*[0-9]+x[0-9]+px-.*' \) | \ | |
xargs du -s | \ | |
awk '{ sum+=$1; } END { print sum/1048576 }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require readline) | |
(require (planet schematics/schemeunit:3:4)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for varnish in $*; do | |
echo "getting interfaces from $varnish" | |
ssh $varnish ifconfig > /tmp/$varnish | |
awk '/^eth1:/{printf $1;next;}1' /tmp/$varnish | grep eth1 | sed 's/^.*inet addr:\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*$/\1/' > /tmp/$varnish.ips | |
done | |
for vhost in `huddler-config -D | grep -v '^#' | awk '{ if ($6 == "prod") { print $1 } }'`; do | |
ip=$(dig $vhost +short | tail -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH thread_album_image_counts AS ( | |
SELECT 'all'::text AS the_set, forum_posts.thread_id, COUNT(*) AS count | |
FROM relations | |
JOIN forum_posts ON ( | |
forum_posts.id = relations.subject_id | |
) | |
JOIN forum_threads ON ( | |
forum_threads.id = forum_posts.thread_id | |
) | |
WHERE relations.type = 'cemi' AND |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT gallery_images.* | |
FROM gallery_images | |
JOIN gallery_album_images ON ( | |
gallery_album_images.image_id = gallery_images.id AND gallery_album_images.is_default | |
) | |
JOIN gallery_albums album ON ( | |
album.id = gallery_album_images.gallery_album_id | |
) | |
LEFT JOIN gallery_albums community ON ( | |
album.object_type = get_huddler_constant('CONTENT_TYPE_GALLERY_ALBUM')::int AND |