Skip to content

Instantly share code, notes, and snippets.

@xorpaul
xorpaul / mpv.conf
Created July 23, 2022 11:40
mpv.conf
geometry=1900x1080
#geometry=+1980+1
# Uses GPU-accelerated video output by default.
vo=gpu-next
# Can cause performance problems with some GPU drivers and GPUs.
profile=gpu-hq
# ===== REMOVE THE ABOVE FOUR LINES AND RESAVE IF YOU ENCOUNTER PLAYBACK ISSUES AFTER =====
@xorpaul
xorpaul / elasticsearch_tuning.md
Last active August 11, 2022 12:42
Elasticsearch tuning

increase refresh_interval from the default 1s if you don't need it instantaneously available

curl -X PUT  -H 'Content-Type: application/json' -d '{ "index": { "refresh_interval": "30s" } }' http://$(hostname -f):9200/_settings

Whether or not to fsync and commit the translog after every index, delete, update, or bulk request. Increased risk of data loss if elasticsearch crashes

curl -X PUT  -H 'Content-Type: application/json' -d '{ "index": { "translog.durability": "async" } }' http://$(hostname -f):9200/_settings

set number_of_shards according to how many writes cluster nodes you have/want

  • Added support for r10k-like purge behaviour of stale content

Starting with v.0.7.0 g10k supports the r10k-like purge behaviour of stale content with the different configuration settings purge_level and purge_whitelist as documented here for purge_levels and here for purge_whiltelist

Please check if you need to whitelist files/folders inside your Puppet environments!

As an additional setting, you can also whitelist Puppet environments with deployment_purge_whitelist, that would've been purged by the deployment purge_level. This can be helpful if you have a similar source name or prefix set. E.g. having a source called foobar and

@xorpaul
xorpaul / foreman_api_per_page.md
Created August 15, 2017 15:27
Foreman API Ruby binding per_page

https://github.com/theforeman/foreman_api

  d = ForemanApi::Resources::ConfigTemplate.new(
    {
      :base_url => $logindata[:foreman][:host],
      :username => $logindata[:foreman][:username],
      :password => $logindata[:foreman][:password],
    })

 data = d.index(headers={:page => 1, :per_page => 9000})

Using EJBCA community edition 6.5.0.5 with WildFly 10 and Java 8:

[...]
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
    <endpoint/>
    <connector name="legacy-remoting-connector" socket-binding="legacy-remoting" security-realm="ApplicationRealm">
        <properties>
            <property name="org.xnio.Options.SSL_STARTTLS" value="false"/>
        </properties>
object CheckCommand "check_tcp_wild" {
        import "ipv4-or-ipv6"

        command = [ PluginDir + "/check_tcp " + "$tcp_args$" ]

        vars.tcp_args = "$tcp_args$"
}
@xorpaul
xorpaul / ejbca-add-different-ra-admin-email-adresses.md
Last active April 15, 2016 11:35
EJBCA patch to send approval requests to different email addresses

we want to send certificate approval requests with different EEPs to different RA admin email addresses. Currently EJBCA only supports one email address for this under system configuration.

To configure the different RA admins mailing addresses we are using system properties in the JBoss configuration XML:

@xorpaul
xorpaul / foreman_1_11_0_foreman_install_log
Created April 12, 2016 14:24
foreman 1.11.0 install log
Resolving dependencies...
Installing rake (10.5.0)
Installing i18n (0.7.0)
Installing json (1.8.3)
Installing minitest (5.1.0)
Installing thread_safe (0.3.5)
Installing tzinfo (1.2.2)
Installing activesupport (4.1.14.2)
Installing builder (3.2.2)
Installing erubis (2.7.0)
@xorpaul
xorpaul / foreman_1_11_0_error_report_processing
Created April 12, 2016 14:11
foreman 1.11.0 error during Puppet report processing
2016-04-12T14:08:16 [app] [I] processing report for foobar.domain.tld
2016-04-12T14:08:16 [app] [W] Action failed
| NoMethodError: undefined method `type_changed?' for #<ConfigReport:0x00000009f26198
| /usr/share/foreman/vendor/ruby/2.1.0/gems/activemodel-4.1.14.2/lib/active_model/attribute_methods.rb:435:in `method_missing'
| /usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-4.1.14.2/lib/active_record/attribute_methods.rb:213:in `method_missing'
| /usr/share/foreman/app/models/concerns/foreman/sti.rb:27:in `save_with_type'
| /usr/share/foreman/app/services/report_importer.rb:129:in `create_report_and_logs'
| /usr/share/foreman/app/services/config_report_importer.rb:13:in `create_report_and_logs'
| /usr/share/foreman/app/services/report_importer.rb:40:in `import'
| /usr/share/foreman/app/services/report_importer.rb:20:in `import'
@xorpaul
xorpaul / go_yaml.md
Created July 28, 2015 16:41
Decode YAML in Go
---
cachedir: '/var/cache/g10k'

git:
  provider: 'rugged'
  private_key: '/root/coro'
  username: 'git'

sources: