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
| class Property { | |
| def static Properties instance | |
| public static readProps(String file_name_prop) { | |
| if (!file_name_prop) throw new Exception("You must provide filename to read properties: this is a static method") | |
| def file_prop = new File(file_name_prop) | |
| if (!file_prop.exists()) { | |
| throw new Exception("The file ${file_name_prop} must exists") | |
| } |
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
| select | |
| fs.tablespace_name "Tablespace", | |
| (df.totalspace - fs.freespace) "Used MB", | |
| fs.freespace "Free MB", | |
| df.totalspace "Total MB", | |
| round(100 * (fs.freespace / df.totalspace)) "Pct. Free" | |
| from | |
| (select | |
| tablespace_name, | |
| round(sum(bytes) / 1048576) TotalSpace |
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
| #!/bin/sh | |
| while read branch; do | |
| upstream=$(git rev-parse --abbrev-ref $branch@{upstream} 2>/dev/null) | |
| if [[ $? == 0 ]]; then | |
| echo $branch tracks $upstream | |
| else | |
| echo $branch has no upstream configured | |
| git branch -D $branch | |
| if [ -z $? ]; then |
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
| #!/bin/bash | |
| NAME_KEY=key | |
| FILE=${NAME_KEY} | |
| PRV_KEY_HEX=${FILE}.hex64.key | |
| PRV_KEY=${FILE}.pem | |
| CERT_REQUEST=${FILE}.csr | |
| CERTIFICATE=${FILE}.crt | |
| PKCS12_FILE=${FILE}.pkcs12 |
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
| # The command finds the most recent tag that is reachable from a commit. | |
| # If the tag points to the commit, then only the tag is shown. | |
| # Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
| # and the abbreviated object name of the most recent commit. | |
| git describe | |
| # With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
| git describe --abbrev=0 | |
| # other examples |
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
| -- Exercise 6.4: Write a function to shuffle a given list. Make sure that all permutations are equally probable. | |
| function q4(...) | |
| items = table.pack(...) | |
| itemsr = {} | |
| for i=1,#items do | |
| math.randomseed(os.time()) | |
| pick = math.random(#items) | |
| print("Picked item:", pick) | |
| table.insert(itemsr,items[pick]) | |
| table.remove(items, pick) |
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
| COMPANY_CERT=certnew | |
| COMPANY_CERT_ORIGINAL=${COMPANY_CERT}.p7b | |
| COMPANY_CERT_NAME=company_certificates.cer | |
| COMPANY_CERT_PKCS7_DER=${COMPANY_CERT}.der.p7b | |
| COMPANY_CERT_PKCS7_PEM=${COMPANY_CERT}.pem.p7b | |
| PRIVATE_KEY=private | |
| PRIVATE_KEY_LEN=2048 | |
| PUBLIC_KEY_EXPIRY_DAYS=365 | |
| PUBLIC_KEY=public | |
| CERTIFICATE_REQUEST=request |
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
| @echo off | |
| SETLOCAL | |
| if "%1%"=="" ( | |
| echo Please, fill JDK exe installer as first parameter | |
| exit /B | |
| ) | |
| set z7="C:\Program Files\7-Zip\7z.exe" |
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
| ls -lap | grep -v / | awk '{ | |
| size = size + $5; | |
| } | |
| END { | |
| print size/1024 | |
| }' |
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
| # Install protobuf | |
| brew install protobuf | |
| brew install swift-protobuf | |
| flutter pub global activate protoc_plugin | |
| echo ' | |
| # Flutter binaries | |
| export FLUTTER_HOME="$HOME/work/apps/flutter" | |
| export DART_HOME="$FLUTTER_HOME/bin/cache/dart-sdk" | |
| export PATH="$PATH":"$FLUTTER_HOME/bin":"$FLUTTER_HOME/.pub-cache/bin":"$DART_HOME/bin"' > $HOME/.bashrc |