Skip to content

Instantly share code, notes, and snippets.

View delphym's full-sized avatar
🏠
Transforming existing jobs to Jenkins Pipelines

DelphyM delphym

🏠
Transforming existing jobs to Jenkins Pipelines
  • Christchurch, NZ
  • 00:58 (UTC -12:00)
View GitHub Profile
@delphym
delphym / install-zsh-windows-git-bash.md
Last active November 30, 2023 23:36 — forked from fworks/install-zsh-windows-git-bash.md
Zsh / Oh-my-zsh on Windows Git Bash
@delphym
delphym / compress-pdf-with-gs.md
Created June 3, 2021 09:52 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@delphym
delphym / Jenkins+Script+Console.md
Created April 1, 2020 20:18 — forked from mubbashir/Jenkins+Script+Console.md
jenkins groovy scripts collection.
@delphym
delphym / fix-git-line-endings
Last active September 12, 2019 01:26 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@delphym
delphym / README.md
Last active July 31, 2019 10:03 — forked from matijs/README.md
Solarized Dark profile for macOS Terminal.app

Solarized Dark profile for Terminal.app on macOS High Sierra

Based on the excellent Solarized (Dark) created by Ethan Schoonover. For source code, check the main Solarized repository on GitHub.

Installation

Open and save Solarized Dark.terminal.

Import from the “Profiles” tab in the settings of Terminal.app or just double-click the file after downloading.

@delphym
delphym / find_replace_recursive_regex.py
Created March 5, 2019 01:52
Recursively find and replace text in files under a specific folder with preview of changed data in dry-run mode, and optional backup.
#!/usr/bin/env python
"""
Recursively find and replace text in files under a specific folder with preview of changed data in dry-run mode.
The preview is automatically shown in `--dry-run` mode.
To also show the preview for write mode use the verbose flag, i.e. `--verbose` or `-v`.
Parameters should preferrably use single quotes, especially for the glob switch, i.e. `--glob='*.html'`.
@delphym
delphym / git_retag
Created October 24, 2018 23:47 — forked from lucijafrkovic/git_retag
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d V_1_0_1
3. push tag deletion to remote
git push origin :refs/tags/V_1_0_1
4. tag local branch again
@delphym
delphym / clean.sh
Last active February 25, 2021 16:49 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
# source of the script can be found at: https://gist.github.com/ad3bbd9d5cafea47bfd66367a0a8cdb6.git
#Check the space on the computer before clean up
df -h
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
@delphym
delphym / jenkins-home-git.sh
Last active June 28, 2018 08:49 — forked from cenkalti/jenkins-home-git.sh
Backup Jenkins home periodicallly with git.
#!/bin/bash
# Script origin @ https://gist.github.com/delphym/687927bf521f598714e27804304ceca4
# Setup
#
# - Create a new Jenkins Job
# - Mark "None" for Source Control Management
# - Select the "Build Periodically" build trigger
# - configure to run as frequently as you like
# - Add a new "Execute Shell" build step