I hereby claim:
- I am faishal on github.
- I am faishal (https://keybase.io/faishal) on keybase.
- I have a public key whose fingerprint is F3B7 DD16 C029 8066 AC92 0164 62E4 69AA 0DF4 86C5
To claim this, I am signing this object:
#!/bin/bash | |
for SITE_URL in $(wp site list --fields=domain,path,archived,deleted --format=csv --url=cmsdev.sc.com | grep ",0,0$" | awk -F ',' '{print $1 $2}') | |
do | |
echo "Indexing $SITE_URL ..." | |
echo "--- BEGIN INDEXING $SITE_URL ---" &>> indexing.log | |
wp elasticpress index --setup --url="$SITE_URL" --show-bulk-errors &>> indexing.log | |
echo "--- END INDEXING $SITE_URL ---" &>> indexing.log | |
done |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# Copyright © 2016 Faishal Saiyed | |
cd | |
timestamp=$(date +%s) | |
if [ ! -f openssh-7.3.zip ]; then wget https://github.com/faishal/openssh-portable/releases/download/cent.os.6.7.openssh.7.3p1/openssh-7.3.zip; fi; | |
unzip -o openssh-7.3.zip -d openssh-7.3p1 | |
cd openssh-7.3p1/ | |
cp /etc/pam.d/sshd pam-ssh-conf-$timestamp | |
rpm -U *.rpm | |
yes | cp pam-ssh-conf-$timestamp /etc/pam.d/sshd |
add_action( 'template_redirect', 'wpmu_ssl_template_redirect', 1 ); | |
function wpmu_ssl_template_redirect() { | |
if ( is_ssl() && ! is_admin() ) { | |
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { | |
wp_redirect( preg_replace( '|^https://|', 'http://', $_SERVER['REQUEST_URI'] ), 301 ); | |
exit(); | |
} else { |
<?php | |
global $wpdb; | |
if ( is_array( $ids ) ) { | |
$in_str_arr = array_fill( 0, count( $ids ), '%d' ); | |
$in_str = join( ',', $in_str_arr ); | |
$form_id_where = $wpdb->prepare( "ID IN ($in_str)", $ids ); | |
} else { | |
$form_id_where = $ids> 0 ? $wpdb->prepare( 'ID=%d', $ids ) : ''; | |
} |
WP_PATH="/var/www/site_path" | |
for SITE_URL in = $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}') | |
do | |
echo $SITE_URL | |
for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}') | |
do | |
echo $EVENT_HOOK | |
wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" > /dev/null 2>&1 | |
done | |
done |
<?php | |
add_action( 'widgets_init', 'nbclatino_top_posts_widget_init' ); | |
function nbclatino_top_posts_widget_init() { | |
// Check if our vip stats function is available | |
if ( !function_exists( 'wpcom_vip_get_stats_array' ) && ! function_exists( 'stats_get_csv' ) ) | |
return; | |
unregister_widget( 'Jetpack_Top_Posts_Widget' ); |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge |
Moved to https://github.com/xwp/vip-quickstart/pull/3 |
//Calculate frame ratio | |
$frame_ratio = ( float ) $frame_w / ( float ) $frame_h ; | |
//Calculate image ratio | |
$image_ratio = ( float ) $image_w / ( float ) $image_h ; | |
//Checking if both ratio are same | |
if ( round ( $frame_ratio , 2 ) != round ( $image_ratio , 2 ) ) { |