This set of cheat sheets is designed to assist you with using various browsers. Little tips and trickes may not know and which I will not remember. Leave a comment or start a discussion if you have something good to add to the list.
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
| def calculate_area(width, height) | |
| raise TypeError, "Width must be a number" unless width.is_a?(Numeric) | |
| raise TypeError, "Height must be a number" unless height.is_a?(Numeric) | |
| raise ArgumentError, "Width must be positive" unless width > 0 | |
| raise ArgumentError, "Height must be positive" unless height > 0 | |
| width * height | |
| end |
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
| #!/usr/bin/env bash | |
| # memory monitor script | |
| # Henri Shustak | |
| # (C) 2022 GNU GPL v3 or later | |
| # basic path setup (good for most systems) | |
| PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
| # settings (this could be improved to use percentages)... |
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 | |
| rsync "$@" 2> >(grep -v vanished) | |
| ret=$? | |
| ((ret==24)) && exit 0 || exit $ret |
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 | |
| #(C) Henri Shustak 2000 | |
| # Released Under the GNU GPLv3 or later | |
| # https://www.gnu.org/licenses/gpl.html | |
| # This script will batch process mkv files (or something else if you modify) and use handbreak (or something else) | |
| # in order to reduce the quaility or convert the format. It will work on these files sequentially and | |
| # keep tabs. If you need to carry on beyond restarts, then it would pay to alter the log file location | |
| # so it is not deleted between reboots. |
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 | |
| # | |
| # (C)2020 Henri Shustak | |
| # Released Under the MIT Licence | |
| # https://mit-license.org/ | |
| # | |
| # dump the crontab | |
| user_name=$(whoami) | |
| host_name=$(hostname) |
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
| # create a compressed archive from a number of sources | |
| tar -czf compressed-archive.tar.gz /srv/source1 /srv/source2 # ... | |
| # list all .txt files in archive (better if you are hunting into large archives) | |
| tar -tf archive.tar --wildcards '*.txt' | |
| tar -tzf archive.tar.gz --wildcards '*.txt' | |
| # it is possible to use third party tools to mount or explore a compressed tar archive | |
| # eg : | |
| # - https://github.com/mxmlnkn/ratarmount |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| TRIES=0 | |
| until [ $TRIES -eq 10 ] || nc -z localhost 3000; do | |
| sleep 0.1 | |
| TRIES=$(( TRIES+1 )) | |
| done |
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
| require 'csv' | |
| require 'open-uri' | |
| file = "Workbook3.csv" | |
| content = CSV.read(open(file), encoding: 'ISO-8859-1:UTF-8', col_sep: ";") | |
| File.open("output.csv", "w") do |f| | |
| rows = content.map { |row| "\"#{row.join('","')}\"" }.join("\n") | |
| f.puts(rows) |