Skip to content

Instantly share code, notes, and snippets.

View antonkorotkov's full-sized avatar
🖕
f..ck putin

Anton antonkorotkov

🖕
f..ck putin
View GitHub Profile
The gsutil rsync command makes the contents under dst_url the same as the contents under src_url, by copying any missing files/objects, and (if the -d option is specified) deleting any extra files/objects. For example, to make gs://mybucket/data match the contents of the local directory “data” you could do:
gsutil rsync -d data gs://mybucket/data
To recurse into directories use the -r option:
gsutil rsync -d -r data gs://mybucket/data
To copy only new/changed files without deleting extra files from gs://mybucket/data leave off the -d option:
@antonkorotkov
antonkorotkov / gist:9b41d70cb41242a4c81b
Last active November 30, 2015 09:53
expiration.sql
select distinct(`wp_posts`.`ID`),`wp_posts`.`post_title`, `wp_users`.`user_email`, `wp_users`.`display_name`, `wp_woocommerce_downloadable_product_permissions`.`access_expires` from `wp_woocommerce_downloadable_product_permissions`,`wp_users`,`wp_posts` where `access_expires` = DATE_SUB(CURDATE(), INTERVAL -205 DAY) and `wp_woocommerce_downloadable_product_permissions`.`user_id` = `wp_users`.`ID` and `wp_posts`.`ID` = `wp_woocommerce_downloadable_product_permissions`.`product_id`;
@antonkorotkov
antonkorotkov / dssdfs
Created January 4, 2016 15:10
dfsdfsdfsdf
Warning: include(/var/www/wp-content/plugins/wp-stateless/vendor/google/apiclient/src/Google/Cache/File.php): failed to open stream: No such file or directory in /var/www/wp-content/plugins/wp-property-agents/vendor/composer/ClassLoader.php on line 412 Warning: include(): Failed opening '/var/www/wp-content/plugins/wp-stateless/vendor/google/apiclient/src/Google/Cache/File.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/wp-content/plugins/wp-property-agents/vendor/composer/ClassLoader.php on line 412 Fatal error: Class 'Google_Cache_File' not found in /var/www/wp-content/plugins/wp-stateless/vendor/google/apiclient/src/Google/Client.php on line 612
<style>
#mc-embedded-subscribe {
background: #b0d26b none repeat scroll 0 0 !important;
border-bottom: 0 none !important;
float: left;
font-size: 14px !important;
height: 40px;
min-width: 20px !important;
opacity: 1;
padding: 0 !important;
@antonkorotkov
antonkorotkov / google-cloud-storage-upload-download.php
Created February 16, 2016 16:41 — forked from stetic/google-cloud-storage-upload-download.php
PHP Example for Google Storage Upload and Download with Google APIs Client Library for PHP
<?php
/*
* PHP Example for Google Storage Up- and Download
* with Google APIs Client Library for PHP:
* https://github.com/google/google-api-php-client
*/
include( "Google/Client.php" );
include( "Google/Service/Storage.php" );
git subtree push --prefix=wp-content/plugins/wp-property-supermap [email protected]:wp-property/wp-property-supermap develop-rdc --squash
@antonkorotkov
antonkorotkov / macos_zip_without_hidden.sh
Created June 15, 2016 08:56
MacOS zip without hidden files
zip -r -X Archive.zip *
@antonkorotkov
antonkorotkov / fix_perms.sh
Created July 5, 2016 12:20
File permissons fix
sudo find ./ -type d -exec chmod 755 {} +
sudo find ./ -type f -exec chmod 644 {} +
sudo chmod -R u+rwX,go+rX,go-w ./
sudo chown -R core:core ./
[
{
"s2_cell_id": {
"low": 1073741824,
"high": 1093116151,
"unsigned": true
},
"current_timestamp_ms": {
"low": 595677659,
"high": 342,
@antonkorotkov
antonkorotkov / replace_in_file.sh
Created September 19, 2017 08:25
bash ssh replace in file
sed -i -e 's/abc/XYZ/g' /tmp/file.txt