Skip to content

Instantly share code, notes, and snippets.

View hennevogel's full-sized avatar
🍻
Ewiger Feierabend

Henne Vogelsang hennevogel

🍻
Ewiger Feierabend
View GitHub Profile
# this is to speed up secure Project.find
def self.forbidden_project_ids
# Admins don't have forbidden projects
return [0] if User.current && User.current.is_admin?
# This will cache and return an array:
# [ Project1_id, Project2_id, Project3_id ]
forbidden_projects = Rails.cache.fetch('forbidden_projects') do
# We use project_user_cache to calculate this...
Rails.cache.delete('allowed_forbidden_projects_by_user')
RSpec.feature "Blah", :type => :feature do
context "blubb" do
describe "blabber" do
it 'does something' do
...
end
end
end
umount /home
cryptsetup luksFormat /dev/sdb6
# choose the same password as for your login on this machine
cryptsetup luksOpen /dev/sdb6 home_crypto
mkfs.ext4 /dev/mapper/home_crypto
mount /dev/mapper/home_crypto /home
mv /home_new /home
# login again and come back to IRC :-)
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<!--
See pam_mount.conf(5) for a description.
-->
<pam_mount>
<!-- debug should come before everything else,
since this file is still processed in a single pass
  • Approach A: Remove Events table, every time something happens schedule a mulitpurpose job.
  • Approach B: Remove Events table, every time something happens schedule multiple single purpose jobs.
. Both solutions Approach A Approach B
Pro No No duplication of event data. Makes the events table redundant - we can easily get rid of the table and use the Event classes as POROs
Pro Failures and retries can be handled by delayed job. . No need to check when events can be deleted
Pro Failed jobs can be re-run manually . No hacking of delayed job gem required
Pro Individual queues would not be necessary . .
. . . .
@hennevogel
hennevogel / ESADO.v2.md
Last active July 20, 2017 13:06 — forked from mdeniz/ESADO.md
Event System Architectural Design Options
use Net::Domain;
use Socket;
my $frontend="frontend";
# If defined, restrict access to the backend servers (bs_repserver, bs_srcserver, bs_service)
our $ipaccess = {
'127\..*' => 'rw', # only the localhost can write to the backend
"^$ip" => 'rw', # Permit IP of FQDN
'.*' => 'worker', # build results can be delivered from any client in the network
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zypper] main.cc(main):74 ===== Hi, me zypper 1.13.28
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zypper] main.cc(main):75 ===== 'zypper' '-n' 'install' '--no-recommends' '--replacefiles' 'obs-server' 'obs-signd' 'obs-service-download_src_package' 'obs-service-download_files' 'obs-service-download_url' 'obs-service-format_spec_file' 'obs-service-kiwi_import' 'perl-Devel-Cover' 'osc' =====
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zconfig] ZConfig.cc(_autodetectSystemArchitecture):73 Uname architecture is 'x86_64'
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zconfig] ZConfig.cc(_autodetectTextLocale):209 Default text locale is 'en'
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zconfig] ZConfig.cc(Impl):341 libzypp: 16.13.0
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zypp] IniParser.cc(parse):84 Start parsing /etc/zypp/zypp.conf[g___]
2017-09-05 09:47:35 <1> 0242a1142d89(41) [zypp] IniParser.cc(parse):138 Done parsing /etc/zypp/zypp.conf[_eF_]
2017-09-05 09:47:35 <1> 0242a1142d89(4
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zypper] main.cc(main):74 ===== Hi, me zypper 1.13.28
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zypper] main.cc(main):75 ===== 'zypper' 'ref' '-f' =====
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zconfig] ZConfig.cc(_autodetectSystemArchitecture):73 Uname architecture is 'x86_64'
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zconfig] ZConfig.cc(_autodetectTextLocale):209 Default text locale is 'en'
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zconfig] ZConfig.cc(Impl):341 libzypp: 16.13.0
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zypp] IniParser.cc(parse):84 Start parsing /etc/zypp/zypp.conf[g___]
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zypp] IniParser.cc(parse):138 Done parsing /etc/zypp/zypp.conf[_eF_]
2017-09-05 10:03:41 <1> 0242a1142d89(563) [Progress++] ProgressData.cc(report):88 {#1|/etc/zypp/zypp.conf}END
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zconfig] ZConfig.cc(Impl):605 ZConfig singleton created.
2017-09-05 10:03:41 <1> 0242a1142d89(563) [zconfig] ZConfi
Event::CommentForProject
Event::Subscription -> Event::CommentForProject
-> User/Group
Event.all each do | event |
Event::CommentForProject > Event::Subscription > *User* > do something
end