This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a script build to be run by nagios/icinga plugin system. It takes check who log ago is that thas synoic snapshot. We build this to be run on our server being backed up, as we are buying backup solution and we want to check that it was been copied out. If we has access to the server backing up our server we could have used sanoid --monitor-snapshots to verify that is has uptodate snapshots. | |
example | |
./check_syncoid asdasd -w 60 -c 90 -h spike -z lxd -r | |
-r traverse over a dataset recursively | |
-z <s> sets s ZFS dataset to check | |
-w <n> sets n to minutes before it is warning | |
-c <n> sets n to minutes before it is critical | |
-h <s> sets s as the hostname in the syncoid snapshot name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/components/link_as_button.rb | |
class LinkAsButton | |
attr_reader :href | |
attr_reader :disabled | |
def initialize( | |
href:, | |
disabled: false | |
) | |
@href = href |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# oneline | |
a=[self].unshift 'secret';a.unshift 33;a.unshift :unlock;s=%w[se nd].join'';m=self.prison.method s.to_sym;m.to_proc[*a] | |
# mulltiline | |
a=[self].unshift 'secret'; | |
a.unshift 33; | |
a.unshift :unlock; | |
s=%w[se nd].join''; | |
m=self.prison.method s.to_sym; | |
m.to_proc[*a] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-2.4.2 | |
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux] | |
Environment | |
Ruby ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin17] | |
Rubygems 2.6.13 | |
Bundler 1.16.0 | |
Command /Users/user_name/.rbenv/versions/2.4.2/gemsets/product/bin/cap fb2016 doctor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var send = XMLHttpRequest.prototype.send, | |
token = document.querySelector("meta[name=csrf-token]").getAttribute("content"); | |
XMLHttpRequest.prototype.send = function(data){ | |
this.setRequestHeader('X-CSRF-Token', token); | |
return send.apply(this, arguments); | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Regneklynge { | |
int antNode; | |
ArrayList<Rack> racks = new ArrayList<Rack>(); | |
public void setInnNode(Node node){ | |
boolean sattInn = false | |
for (int i = 0; i < racks.length-1; i++) { | |
if (racks[i].setinNode(node)) { | |
sattInn = true; | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setCurrentTabName () { | |
WID=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| awk '{print $5}') | |
xdotool windowfocus $WID | |
xdotool key ctrl+i | |
xdotool key BackSpace | |
xdotool type $1 | |
xdotool key Return | |
} | |
function maybeCreateNewTab() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function g { | |
# if you not in a repo STOP now | |
case $1 in | |
'' ) | |
git status | |
;; | |
'loop' ) | |
git_status_res_without_delete=$(git status | grep -v 'On branch' | grep -v 'Your branch is' | grep -v 'use "git push" to publish' | grep -v 'Changes to be committed' | grep -v 'use "git reset HEAD' | grep -v 'Changes not staged for' | grep -v 'to update what will be committed' | grep -v 'discard changes in working directory' | grep -v 'include in what will be committed' | grep -v "grep -v 'include in what will be committed'"| grep -v "git branch --unset-upstream" | grep -v "added to commit but untracked files present" | grep -v "nothing to commit, working dir" | grep -v " deleted: " | grep -v "Your branch and" | grep -v "different commits each, respectively." | grep -v "to merge the remote branch into yours)" | grep -v "You have unmerged paths" | grep -v "(fix conflicts and run " | grep -v "Unmerged paths:" | grep -v "to mark resolution)" | grep -v "renamed: ") |