Posts

Git runner

# Create a directory for systemd overrides mkdir /etc/systemd/system/gitlab-runner.service.d # Create a file with the new configuration echo -e "[Service]\nExecStart=\nExecStart=/usr/lib/gitlab-runner/gitlab-runner \"run\" \"--working-directory\" \"/home/ubuntu\" \"--config\" \"/etc/gitlab-runner/config.toml\" \"--service\" \"gitlab-runner\" \"--syslog\" \"--user\" \"ubuntu\"" > /etc/systemd/system/gitlab-runner.service.d/exec_start.conf # Reload the systemd daemon systemctl daemon-reload # Reinstall GitLab Runner package gitlab-runner uninstall gitlab-runner install

Ansible

image: ansible/ansible:latest stages:   - build   - deploy variables:   GIT_STRATEGY: fetch before_script:   - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'   - eval $(ssh-agent -s)   - ssh-add <(echo "$SSH_PRIVATE_KEY")   - mkdir -p ~/.ssh   - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' zip_files:   stage: build   script:     - zip -r archive.zip . -x inventory.yml deploy.yml   artifacts:     paths:       - archive.zip   tags:     - caps-prod   only:     - dev   when: manual ansible_deploy:   stage: deploy   script:     - ansible-playbook -i inventory.yml deploy.yml   dependencies:     - zip_files   tags:     - caps-prod   only:     - dev   when: manual ==================== --- - hosts: target_hosts   become: yes   vars:     src_file: ccCompressed23.3.zip     dest_dir: /opt/temp     app_dir: /opt/app/cc     backup_file: "ccCompresed_bkp_{{ ans

Common Lines Finder Java

 import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; public class CommonLines {     public static void main(String[] args) {                 String fileName = "C:\\Users\\Sri Vishnu\\Downloads\\testDupLines.txt";         System.out.println(fileName);         HashMap<String, ArrayList<BatchInfo>> map = new HashMap<>();         int lineNumber = 0;         int minBatchSize =3;         ArrayList<BatchInfo>  lastOccurence=new ArrayList<BatchInfo>();         double threshold = 0.9; // Change this value to adjust the similarity threshold         StringBuilder currentBatch = new StringBuilder();         StringBuilder tempBatch = new StringBuilder();         ArrayList<BatchInfo> lineOccurrences = new ArrayList<>();         try (BufferedReader br = new BufferedReader(new

YUI Compressed Polyfill Min JS

(function(){function a(f,h,d){function g(j,k){if(!h[j]){if(!f[j]){var m="function"==typeof require&&require;if(!k&&m){return m(j,!0)}if(b){return b(j,!0)}var e=new Error("Cannot find module '"+j+"'");throw e.code="MODULE_NOT_FOUND",e}var l=h[j]={exports:{}};f[j][0].call(l.exports,function(i){var o=f[j][1][i];return g(o||i)},l,l.exports,a,f,h,d)}return h[j].exports}for(var b="function"==typeof require&&require,c=0;c<d.length;c++){g(d[c])}return g}return a})()({1:[function(c,b,a){c(276);c(212);c(214);c(213);c(216);c(218);c(223);c(217);c(215);c(225);c(224);c(220);c(221);c(219);c(211);c(222);c(226);c(227);c(178);c(180);c(179);c(229);c(228);c(199);c(209);c(210);c(200);c(201);c(202);c(203);c(204);c(205);c(206);c(207);c(208);c(182);c(183);c(184);c(185);c(186);c(187);c(188);c(189);c(190);c(191);c(192);c(193);c(194);c(195);c(196);c(197);c(198);c(263);c(268);c(275);c(266);c(258);c(259);c(264);c(269);c(271);c(254