I hereby claim:
- I am keeross on github.
- I am keeross (https://keybase.io/keeross) on keybase.
- I have a public key whose fingerprint is 7C5E A2EB 82EB C279 D15D 8822 3320 06B9 7A7C DBD0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
namespace :db do | |
def detect_env | |
ENV['RAILS_ENV'] || 'development' | |
end | |
def truncate(table) | |
begin | |
case @config["adapter"] | |
when "mysql", "mysql2" | |
ActiveRecord::Base.connection.execute("TRUNCATE #{table}") | |
puts "Table #{table} truncated!" |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
auto eth0 | |
iface eth0 inet static | |
address <your-vm-ip-address> | |
netmask <your-netmask(ex:255.255.255.255)> | |
broadcast <your-vm-ip-address> | |
post-up route add <your-server-getaway-ip(ex: usually ends with .1)> dev eth0 | |
post-up route add default gw <your-server-getaway-ip(ex: usually ends with .1)> | |
post-down route del <your-server-getaway-ip(ex: usually ends with .1)> dev eth0 | |
post-down route del default gw <your-server-getaway-ip(ex: usually ends with .1)> | |
dns-nameservers 8.8.8.8 8.8.4.4 |
<?php | |
// Add this to your functions.php | |
// Discourage wordpress plugin updates | |
function no_plugin_updates($value) { | |
unset($value->response[ plugin_basename('pluginfolder/pluginfile.php') ]); | |
return $value; | |
} | |
add_filter('site_transient_update_plugins', 'no_plugin_updates'); |
# encoding: utf-8 | |
## | |
# Backup Generated: app_backup | |
# Once configured, you can run the backup with the following command: | |
# | |
# $ backup perform -t app_backup [-c <path_to_configuration_file>] | |
# | |
# For more information about Backup's components, see the documentation at: | |
# http://backup.github.io/backup |
# config/routes.rb | |
YandexKassaIntegration::Application.routes.draw do | |
# ... | |
scope '/yandex_kassa' do | |
controller 'yandex_kassa', constraints: { subdomain: 'ssl' } do | |
post :check | |
post :aviso | |
get :success | |
get :fail |
find /var/www/html -type f -iname "*" -print0 | xargs -I {} -0 chmod 0444 {}
find /var/www/html -type d -iname "*" -print0 | xargs -I {} -0 chmod 0544 {}
If you’re trying to delete a very large number of files at one time (I deleted a directory with 485,000+ today), you will probably run into this error:
/bin/rm: Argument list too long.
The problem is that when you type something like “rm -rf ”, the “” is replaced with a list of every matching file, like “rm -rf file1 file2 file3 file4” and so on. There is a reletively small buffer of memory allocated to storing this list of arguments and if it is filled up, the shell will not execute the program. To get around this problem, a lot of people will use the find command to find every file and pass them one-by-one to the “rm” command like this:
find . -type f -exec rm -v {} \;
My problem is that I needed to delete 500,000 files and it was taking way too long.