Skip to content

Instantly share code, notes, and snippets.

View ftclausen's full-sized avatar

Friedrich Clausen ftclausen

View GitHub Profile
$ ls /opt/sonatype/sonatype-work/nexus3/db/
OSystem accesslog analytics audit component config model.properties security
$ docker-compose exec nexus java -jar ./lib/support/nexus-orient-console.jar
CONNECT PLOCAL:/opt/sonatype/sonatype-work/nexus3/db/component admin admin
REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
@andyrbell
andyrbell / docker-image-size.sh
Last active June 3, 2024 16:58
Sort docker images by size desc
#!/bin/sh
docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r | column -t
import UIKit
class SleepLogCollectionViewFlowLayout: UICollectionViewFlowLayout {
override func targetContentOffset(
forProposedContentOffset proposedContentOffset: CGPoint,
withScrollingVelocity velocity: CGPoint
) -> CGPoint {
var _proposedContentOffset = CGPoint(
x: proposedContentOffset.x, y: proposedContentOffset.y
cd /Library/Preferences
sudo rm com.sophos.sav.plist

cd /Library/Application\ Support/Sophos/cloud/Installer.app/Contents/MacOS/tools/
sudo ./InstallationDeployer —force_remove
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@jaibeee
jaibeee / brew-perms.sh
Last active February 15, 2024 22:49
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
import UIKit
class EMCollectionViewFlowLayout: UICollectionViewFlowLayout {
override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
var _proposedContentOffset = CGPoint(x: proposedContentOffset.x, y: proposedContentOffset.y)
var offSetAdjustment: CGFloat = CGFloat.max
let horizontalCenter: CGFloat = CGFloat(proposedContentOffset.x + (self.collectionView!.bounds.size.width / 2.0))
let targetRect = CGRect(x: proposedContentOffset.x, y: 0.0, width: self.collectionView!.bounds.size.width, height: self.collectionView!.bounds.size.height)
@quidryan
quidryan / build.gradle
Last active February 14, 2024 22:22
Code to use ssh-agent when using JGit. Running in Gradle with the gradle-git plugin.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:0.5.0' // not used in this example, but it's what brings in JGit
classpath 'com.jcraft:jsch.agentproxy.jsch:0.0.5'
classpath 'com.jcraft:jsch.agentproxy.usocket-jna:0.0.5'
classpath 'com.jcraft:jsch.agentproxy.sshagent:0.0.5'
}
@aaronbuchanan
aaronbuchanan / gist:5341619
Created April 8, 2013 23:47
UI/UX OmniGraffle Stencils
A bunch of stenciles for wireframing, data & user flow diagrams and more:
Empty Chrome Browser Window:
https://www.graffletopia.com/stencils/938
Twitter Bootstrap UI:
https://www.graffletopia.com/stencils/934
Google Web GUI:
https://www.graffletopia.com/stencils/10431
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name