Skip to content

Instantly share code, notes, and snippets.

View ivanoats's full-sized avatar
💭
🤙 Stoked 🏄‍♂️

Ivan Storck ivanoats

💭
🤙 Stoked 🏄‍♂️
View GitHub Profile
@ivanoats
ivanoats / gist:815456
Created February 7, 2011 22:55
chkrootkit output
ivan:~/src/chkrootkit-0.49 → make sense
gcc -DHAVE_LASTLOG_H -o chklastlog chklastlog.c
chklastlog.c:85: warning: ‘utmp’ is deprecated (declared at /usr/include/utmp.h:96)
chklastlog.c: In function ‘main’:
chklastlog.c:97: warning: ‘lastlog’ is deprecated (declared at /usr/include/utmp.h:90)
chklastlog.c:98: warning: ‘utmp’ is deprecated (declared at /usr/include/utmp.h:96)
chklastlog.c:154: warning: ‘utmp’ is deprecated (declared at /usr/include/utmp.h:96)
chklastlog.c:155: warning: ‘utmp’ is deprecated (declared at /usr/include/utmp.h:96)
chklastlog.c:166: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘int’
chklastlog.c:166: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘uid_t’
@ivanoats
ivanoats / Rakefile
Created March 12, 2011 21:56
why is @filename nil
desc "Dump the current production database to a MySQL file"
task :dump_remote, :filename do |t, args|
if args
@filename = args[:filename]
else
@filename = "db-backups/production_data-#{Time.now.strftime("%Y-%m-%d-%H%M")}.sql"
end
puts @filename
end
@ivanoats
ivanoats / Rakefile
Created March 13, 2011 20:42
Rakefile for WordPress and Joomla project deployment from localhost to remote
# Copyright 2011 Ivan Storck
# Rakefile to manage automated local / remote sync of PHP projects like WordPress and Joomla
# Assumptions:
# Git is the version control system
# Only tested with ssh shortcuts in .ssh/config and public keys but should work with username and password too
# for WordPress , .gitignore ignores wp-config.php
# for Joomla, .gitignore ignores configuration.php
require 'rake'
require 'net/ssh'
@ivanoats
ivanoats / rvm
Created March 17, 2011 22:43
rvm debugging. why is it not trusting my .rvmrc 's
ivan:~/Development/ruby/clients/cadvbe/cadvbesearch [git:master?] → set -x ; cd ~/Development/ruby/clients/cadvbe/cadvbesearch ;type rvm | head -1
+ set -x
+ cd /Users/ivan/Development/ruby/clients/cadvbe/cadvbesearch
+ builtin cd /Users/ivan/Development/ruby/clients/cadvbe/cadvbesearch
+ local result=0
+ __rvm_project_rvmrc
+ local cwd
+ cwd=/Users/ivan/Development/ruby/clients/cadvbe/cadvbesearch
+ :
+ [[ -z /Users/ivan/Development/ruby/clients/cadvbe/cadvbesearch ]]
@ivanoats
ivanoats / TwitterPicker.rb
Created May 2, 2011 21:41
Pick a random winner from range of @reply tweets
# ruby-1.9.2-p180
require 'twitter' #gem install twitter
require 'ap' #gem install awesome_print
Twitter.configure do |config|
config.consumer_key = 'top secret'
config.consumer_secret = 'top secret'
config.oauth_token = 'top secret'
config.oauth_token_secret = 'top secret'
end
@ivanoats
ivanoats / gist:983886
Created May 20, 2011 21:42
refinery install error
ivan:~/Development/ruby/testcms [git:master?] → rails generate refinerycms_blog
create db/migrate/20110520213837_create_blog_structure.rb
create db/migrate/20110520213838_add_user_id_to_blog_posts.rb
create db/seeds/refinerycms_blog.rb
------------------------
Now run:
rake db:migrate
------------------------
ivan:~/Development/ruby/testcms [git:master?] → rake db:migrate
(in /Users/ivan/Development/ruby/testcms)
@ivanoats
ivanoats / gist:1004706
Created June 2, 2011 16:04
WP to Refinery import
ivan:~/Development/ruby/refinerycms/ivanenviroman [git:master] → bundle exec rake wordpress:import[~/Downloads/wordpress.2010-07-01.2011-05-01.xml] --trace
** Invoke wordpress:import (first_time)
** Execute wordpress:import
** Invoke environment (first_time)
** Execute environment
rake aborted!
Given file '/Users/ivan/Development/ruby/refinerycms/ivanenviroman/~/Downloads/wordpress.2010-07-01.2011-05-01.xml' no file or not readable.
/Users/ivan/.rvm/gems/ruby-1.9.2-p180@refinerycms/bundler/gems/refinerycms-blog-3fcf7e43873d/lib/tasks/wordpress.rake:21:in `block (2 levels) in <top (required)>'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180@refinerycms/gems/rake-0.9.0/lib/rake/task.rb:205:in `call'
/Users/ivan/.rvm/gems/ruby-1.9.2-p180@refinerycms/gems/rake-0.9.0/lib/rake/task.rb:205:in `block in execute'
heroku rake db:migrate
(in /app)
rake aborted!
uninitialized constant Rake::DSL
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rdoctask.rb:20:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:15:in `block in <top (required)>'
@ivanoats
ivanoats / gist:1045159
Created June 24, 2011 16:36
How does this validation fail in console but not in rspec?
ivan:~/Development/ruby/IvanEnviromanRefinery [git:master+] → bundle exec rspec ../refinerycms-link/
.............................F.
Failures:
1) BlogPost bookmark links must have a link url if it is a link
Failure/Error: Factory.build(:post,
expected valid? to return false, got true
# /Users/ivan/Development/ruby/refinerycms-link/spec/models/blog_post_spec.rb:197:in `block (3 levels) in <top (required)>'
require 'acts-as-taggable-on'
require 'seo_meta'
class BlogPost < ActiveRecord::Base
is_seo_meta if self.table_exists?
default_scope :order => 'published_at DESC'
#.first & .last will be reversed -- consider a with_exclusive_scope on these?