Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Mateev benjaminmateev

View GitHub Profile
View anacron log
Nov 1 06:52:01 definingthenextdecade CRON[30362]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ))
Nov 1 06:52:05 systemd[1]: Starting Daily apt upgrade and clean activities...
Nov 1 06:52:25 systemd[1]: Reloading.
Nov 1 06:52:26 systemd[1]: Stopping LSB: automatic crash report generation...
Nov 1 06:52:26 apport[30649]: * Stopping automatic crash report generation: apport
Nov 1 06:52:26 apport[30649]: ...done.
Nov 1 06:52:26 systemd[1]: Stopped LSB: automatic crash report generation.
Nov 1 06:52:26 systemd[1]: Reloading.
Nov 1 06:52:26 systemd[1]: Starting Daily apt download activities...
Nov 1 06:52:26 systemd[1]: Reloading.
@benjaminmateev
benjaminmateev / application.rb
Created Jun 18, 2015
Default Application.rb
View application.rb
# config/application.rb
# Don't generate assets and helpers
config.generators do |g|
g.assets = false
g.helper = false
end
# Don't include all helpers globally, just the right helper for the current namespace
config.action_controller.include_all_helpers = false
View process_substitution.sh
# Apart from simplicity, another advantage of using process
# substitution is Bash will automatically parallelize your tasks.
diff <(curl http://somesite/file1) <(curl http://somesite/file2)
# Where some-command accepts a filename (or multiple filenames)
# as arguments, and another-command writes output to stdout.
some-command <(another-command)
View gist:1126056
log_level :info
log_location STDOUT
node_name 'benjaminmateev'
client_key '/Users/benjamenmateev/Sites/xxx/chef/chef-repo/.chef/benjaminmateev.pem'
validation_client_name 'chef-validator'
validation_key '/etc/chef/validation.pem'
chef_server_url 'http://chef.xxx.com:4000'
cache_type 'BasicFile'
cache_options( :path => '/Users/benjamenmateev/Sites/xxx/chef/chef-repo/.chef/checksums' )
@benjaminmateev
benjaminmateev / gist:1125355
Created Aug 4, 2011
jQuery UI Autocomplete in Coffeescript
View gist:1125355
$ ->
$('#header_search').autocomplete
source: "/search/autocomplete"
formatItem: (item) ->
"<img src=\"#{item.url}\" />#{item.title}"
select: (event, ui) ->
location.href = ui.item.href
@benjaminmateev
benjaminmateev / gist:1101450
Created Jul 23, 2011
Workaround for Debian Bug
View gist:1101450
tail -f /va-bash: /dev/fd/62: No such file or directory
-bash: /dev/fd/60: No such file or directory
# Workaround:
sudo ln -s /proc/self/fd /dev/fd
View Capistrano-Deployment-Recipe.rb
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@benjaminmateev
benjaminmateev / gist:857161
Created Mar 6, 2011
Categories Index not working in Magento Admin
View gist:857161
app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php
<?php
public function getRowUrl($row) {
return $this->getUrl(’*/*/edit’, array(’page_id’ => $row->getId()));
}
?>
View Mount NFS in OpenVZ VM
# vim /etc/sysctl.conf
sunrpc.ve_allow_rpc = 1
fs.nfs.ve_allow_nfs = 1
kernel.ve_allow_kthreads = 1
# sysctl -p
# vzctl stop 101
# vzctl set 101 --features "nfs:on" --save
View Create Symlink