See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.jsonfile in/etc/docker:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| #!/bin/bash | |
| # | |
| # Finds fixed tickets in repository | |
| # | |
| # This script takes Organization, Repository, Github username, Password as inputs. | |
| # It writes all the closed tickets in "closed-issues.txt" file. | |
| # | |
| read -p "Organization: " ORG; read -p "Repository: " REPO; read -p "Github username: " USER; read -s -p "Password: " PASS | |
| CLOSED_FILE="closed-issues.txt" | |
| if [[ ! -e $CLOSED_FILE ]]; then |
| d-i partman/early_command \ | |
| string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" | |
| #d-i debian-installer/locale string en_US.UTF-8 | |
| #d-i keyboard-configuration/xkb-keymap select us | |
| ### Localization | |
| d-i debian-installer/locale string en_US.UTF-8 | |
| d-i debian-installer/keymap select us | |
| d-i keymap select us |
| ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAs/WawczG3eI6JrUPV5iUaiCws5VulzeXqe3xNjyVWbkO/HKlQmF7HVSMhakPjCtBK5S7R6PCKRkYpE4F7rFJ/YVpyBpGz5t3dLzKZ1GXxNW9yc9G5HNC2sVjaSWREpwypfXgDSrtkwtLuhGdddnDx5IOdVFj4C/+SVEfARwraK5YQDarsAwSGCtAEyZVlUWcH11s9KWO5Vqg1uE79nFSwW4+AbGEuCcr7Nm2QESAArVpqcHYptmh/5piZvzvrO9fTOspSJeztCZZiot+NBgnEx2Rbs6C9TGoue+YJvTitTmXyGbOfS/d+M+z8gp9bN3Nf8pFxBVlD1Wor+eNFF9SSQ== burzum@lynx |
| check minidns | |
| check checktls.com | |
| -- | |
| ## | |
| random | |
| ssh [email protected] -p 2022 "tee -a /etc/dropbear/authorized_keys|tee -a ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub | |
| mount -t cifs -o vers=1.0,uid=1000,iocharset=utf8,sec=ntlm,credentials=/tmp/.cred //192.168.123.45/home /tmp/wintmp #synology SMB1 | |
| mount -t cifs -o vers=3.0,uid=1000,iocharset=utf8,sec=ntlmv2,credentials=/tmp/.cred //192.168.123.45/home /tmp/winshare#synology SMB3 | |
| git add -A ;git commit -m "$(date -u +%Y-%m-%d-%H.%M)"" $COMMITCOMMENT" ;git push |
| Jenkins: checkout Gerrit patchset (Gerrit Trigger plugin) | |
| Today I had to setup automatic pipeline triggering for each new patchset pushed to Gerrit for review. The Gerrit Trigger plugin makes it a piece of cake to achieve the goal. | |
| In reply to How to Checkout a Gerrit Change in a Jenkins Sandbox Pipeline: such a snippet can be easily found directly in Jenkins > browse to your pipeline > click "configure" > click "pipeline syntax" > Sample step: select checkout: General SCM > fill what you need, click on advanced and add a refspec and generate the snippet. Here a snippet using the GERRIT variables exposed by the plugin. | |
| node { | |
| stage('checkout gerrit patchset') { | |
| echo "gerrit branch: ${GERRIT_BRANCH}, gerrit refspec: ${GERRIT_REFSPEC}" |
| conn = new URL('https://www.example.com').openConnection() | |
| conn.connect() | |
| println conn.serverCertificates.collect { | |
| it.toString() | |
| }.join('\n') | |
| conn.disconnect() |
| import java.security.* | |
| ks = KeyStore.getInstance('jks') | |
| new File('/etc/pki/java/cacerts').withInputStream { | |
| ks.load(it, 'changeit'.chars) | |
| } | |
| ks.aliases().collect { | |
| "$it: ${ks.getCertificate(it).toString()}" |
| upstream jenkins { | |
| keepalive 32; # keepalive connections | |
| server 127.0.0.1:8080; # jenkins ip and port | |
| } | |
| # Required for Jenkins websocket agents | |
| map $http_upgrade $connection_upgrade { | |
| default upgrade; | |
| '' close; | |
| } |
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json file in /etc/docker:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| # Script to enable port forwarding and IP Masquerading, to share | |
| # the primary internet connection to the second port of DS1512+ | |
| # Setup: | |
| # cp S99iptables_nat.sh /usr/syno/etc.defaults/rc.d/S99iptables_nat.sh && reboot | |
| action=$1 | |
| shift; | |
| local INT_IFACE="eth1" | |
| local IFCFG_FILE="/etc/sysconfig/network-scripts/ifcfg-${INT_IFACE}" |