- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
| ALTER TABLE users ADD COLUMN need_deleted BOOLEAN DEFAULT true; | |
| UPDATE users SET need_deleted=false where id IN (select DISTINCT(user_id) from enrollments); | |
| DELETE FROM eportfolio_entries WHERE eportfolio_id in (select id FROM eportfolios where user_id IN (SELECT id FROM users where need_deleted=true)); | |
| DELETE FROM eportfolio_categories WHERE eportfolio_id in (select id FROM eportfolios where user_id IN (SELECT id FROM users where need_deleted=true)); | |
| DELETE FROM eportfolios where user_id IN (SELECT id FROM users where need_deleted=true); | |
| DELETE FROM account_users where user_id IN (SELECT id FROM users where need_deleted=true); | |
| DELETE FROM user_profiles where user_id IN (SELECT id FROM users where need_deleted=true); |
| # lib/tasks/users.rake | |
| namespace :users do | |
| task spam_clean: :environment do | |
| failed_list = [] | |
| no_users_without_enrollments = 0 | |
| number_of_thread = (ENV['THREADS'] || 10).to_i | |
| total_users = User.count.to_f | |
| offset = (total_users / number_of_thread).ceil | |
| ####################################################################### | |
| failed_list = [] | |
| user_ids_with_enrollment = Enrollment.pluck(:user_id) | |
| users_without_enrollment = User.where.not(id: user_ids_with_enrollment) | |
| users_without_enrollment.find_each do |user| | |
| failed_list << user.id unless user.destroy | |
| end | |
| p "Total users to delete: #{user_without_enrollment.length}" |
| - (void) findANPRInfo:(FindAnprInfoModel *) anpr andDelegate:(id<FindAnprInfoModelDelegate>) delegate { | |
| if (![anpr.plate isEqualToString:@""] && ![anpr.region isEqualToString:@""] && delegate) { | |
| _delegate = delegate; | |
| } | |
| NSMutableDictionary* parameters = [NSMutableDictionary new]; | |
| parameters[@"registration_no"] = anpr.plate; | |
| if ([BPConfiguration loadLoggedStation].identifier > 0) { | |
| parameters[@"device_id"] = [NSString stringWithFormat:@"%@",[BPConfiguration loadLoggedStation].identifier]; |
| t = 236 # seconds | |
| Time.at(t).utc.strftime("%H:%M:%S") | |
| => "00:03:56" | |
| # Reference | |
| # http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
| { | |
| "epoch_start":1525309669055, | |
| "image_car":"http://rohit-ThinkCentre-M72e:32775/img/VK3PS0WWYEDC5KR6FIPIURGXRP82YVV9WZYOFBKD-967255645- | |
| 1525309670374.jpg", | |
| "camera_id":967255645, | |
| "frame_start":569031, | |
| "agent_uid":"VK3PS0WWYEDC5KR6FIPIURGXRP82YVV9WZYOFBKD", | |
| "best_confidence":94.99887084960938, | |
| "company_id":"06e41eca-ef94-41f1-8b4b-f6d7008196cb", |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.confaddress=/local/127.0.0.1
| Config Action Cable | |
| 1. Edit: /etc/nginx/site-enabled/app.careymedical.com | |
| server { | |
| listen 8888; | |
| server_name app.careymedical.com; | |
| ssl on; | |
| ssl_certificate /etc/ssl/careymedical-chained.crt; | |
| ssl_certificate_key /etc/ssl/careymedical.key; |
| ## TRAVEL INFO ############# | |
| {:from=>"BCN", | |
| :start=>Tue, 05 Apr 2016, | |
| :aldults=>1, | |
| :children=>2, | |
| :destinations=>[{:city=>"CDG", :stay=>2}, {:city=>"BIO", :stay=>4}, {:city=>"LCG", :stay=>5}] | |
| } | |
| `First: get all posibile routes from list of cities` | |
| ## ALL POSIBLE ROUTES: |