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 script will create a password with 12 alphanumeric character, split into 3 parts of 4 character each, and using dash "-" as | |
# the separator | |
# | |
# Example: pyYq-gFcn-jRa3 | |
# | |
generate_password () { |
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
from datetime import datetime | |
from datetime import timedelta | |
from datetime import date | |
def friday_the_13th(): | |
today = date.today() | |
current_month = today.month | |
current_year = today.year |
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/env python3 | |
# check_ssl_cert.py - python get info for expired SSL cert | |
# Copyright 2022 Sharuzzaman Ahmat Raslan <sharuzzaman@gmail.com> | |
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. | |
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. | |
# You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/. | |
from cryptography import x509 |
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
qpdf.exe --password=<password> --decrypt ./encrypted_pdf_file.pdf ./decrypted_pdf_file.pdf |
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
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" | jq '[.Reservations[]|.Instances[]|{Name: .Tags[]|select(.Key == "Name").Value,DeviceName: [.BlockDeviceMappings[]|.DeviceName]}]|sort_by(.Name)' ec2.json |
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
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" | jq '.Reservations[]|.Instances[]|{InstanceId,PrivateIpAddress,Name: .Tags[]|select(.Key == "Name").Value}' | jq -n '[inputs]|sort_by(.Name)' |
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
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" | jq '.Reservations[]|.Instances[]|{InstanceId,PrivateIpAddress,Name: .Tags[]|select(.Key == "Name").Value}' |
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/env python3 | |
import calendar | |
import datetime | |
now = datetime.datetime.now() | |
cal = calendar.Calendar() | |
month = 1 |
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 | |
ps2pdf -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage input.pdf output.pdf |
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 | |
curl "https://www.e-solat.gov.my/index.php?r=esolatApi/TakwimSolat&period=today&zone=SGR01" 2>/dev/null| sed 's/,/,\n/g' | egrep 'imsak|fajr|syuruk|dhuhr|asr|maghrib|isha' | tr -dc '[:alnum:]\n:' | sed 's/:/ /' |
NewerOlder