sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
This file contains 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
// Simple way to fetch content from an URL using Groovy | |
println "https://example.com".toURL().text | |
// More information about Groovy URL class: http://docs.groovy-lang.org/latest/html/groovy-jdk/java/net/URL.html |
This file contains 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
# https://xkcd.com/1168/ :) | |
ls -l --block-size=M |
This file contains 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
# Uncomment to disable Certificate errors | |
# [Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} | |
$url = "http://example.com/data.json" | |
$user = "data-user" | |
$password = "password" | |
# Output file path into current directory. | |
$file= ($pwd).path + "\export.json" | |
Write-Host "Exporting data to: $file" |
This file contains 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
def text = "Going to convert this to Base64 encoding!" | |
// Encode | |
def encoded = text.bytes.encodeBase64().toString() | |
println encoded | |
// Decode | |
byte[] decoded = encoded.decodeBase64() | |
println new String(decoded) |
This file contains 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
SET TIMING ON | |
DECLARE | |
START_TIME PLS_INTEGER; | |
COUNT_ROW NUMBER; | |
BEGIN | |
FOR I IN 1..10 LOOP | |
START_TIME := DBMS_UTILITY.GET_TIME(); | |
SELECT COUNT(*) INTO COUNT_ROW FROM (SELECT * FROM PERSON ORDER BY LASTNAME ASC) WHERE ROWNUM <= 50; | |
DBMS_OUTPUT.PUT_LINE('Selected ' || COUNT_ROW || ' in ' || (DBMS_UTILITY.GET_TIME() - START_TIME) || '/100 seconds'); |
This file contains 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
#!/bin/bash | |
# This code is based on the awesome answer by @torek from StackOverflow: | |
# https://stackoverflow.com/a/41626019/195417 | |
# I have only made a shell for his code, added some options, added some colors | |
# and voilà! | |
# | |
# This script can be used to find large files inside a git repository | |
# and it's whole history. It will list files larger than a given threshold, | |
# and display these files in a colored human readable way. | |
# |
This file contains 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
def fullUrl = "http://localhost:8080/emulator/" | |
def url = new URL(fullUrl) | |
def connection = url.openConnection() | |
connection.doOutput = true | |
connection.setRequestMethod("POST") | |
connection.setRequestProperty("Content-Type", 'application/x-www-form-urlencoded') | |
def data = "Text data" | |
def writer = new OutputStreamWriter(connection.outputStream) |
This file contains 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
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'git://git.wincent.com/command-t.git' |
NewerOlder