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 iam list-roles | jq -r '.Roles[].RoleName' | xargs -I % aws iam get-role --role-name % | jq --arg cutoff '2023-04-01T00:00' '.[] | select(.RoleLastUsed.LastUsedDate | . <= $cutoff ) | {RoleName: .RoleName, LastUsedDate: .RoleLastUsed.LastUsedDate}' | jq -s '.' > roles_last_used_april.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
#!/bin/bash | |
if [ $# -ne 2 ]; | |
then echo -e "\nUsage: '$0 <path to mp4 clips> <name of finalized video>'\n" | |
exit 1 | |
fi | |
cd $1 | |
readlink -f *.MP4 > files.txt | |
sed -i -e 's/^/file /' files.txt |
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 takes the number of days to retain AWS Cloudwatch logs as an argument | |
# and updates all AWS Cloudwatch logs policy to the desired retention length | |
if [ $# -eq 0 ] | |
then | |
echo "Please specify the number of days to retain AWS Cloudwatch Logs" | |
echo "Usage: update-log-retention-policy 90" | |
echo "Done" |
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
ffmpeg -i input.mp4 -s 640x480 -c:a copy output.mp4 |
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
ffmpeg -f concat -i join.txt -c copy output.mp4 |
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
ffmpeg -f gif -i infile.gif outfile.mp4 |
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
var spinMeUp = FindViewById<Spinner>(Resource.Id.spinMeUp); | |
var items = new string[] {"Up", "Down", "Left", "Right", "B", "A", "Select", "Start" }; | |
var adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerItem, items); | |
spinMeUp.Adapter = adapter; | |
spinMeUp.Focusable = true; | |
spinMeUp.FocusableInTouchMode = true; | |
spinMeUp.RequestFocus (FocusSearchDirection.Up); |
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
var builder = new AlertDialog.Builder(this); | |
builder.SetTitle ("Test"); | |
builder.SetIcon (Resource.Drawable.Icon); | |
builder.SetMessage ("Click a button"); | |
builder.SetPositiveButton ("Yes", (sender, e) => { | |
Toast.MakeText (this, "You clicked positive button", ToastLength.Short).Show (); | |
}); | |
builder.SetNegativeButton ("No", (sender, e) => { |
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
var editText = FindViewById<EditText>(Resource.Id.search); | |
editText.EditorAction += (object sender, TextView.EditorActionEventArgs e) => { | |
if (e.ActionId == ImeAction.Search) { | |
//do something here when search action button pressed | |
} | |
return; | |
}; |
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
var viewContainer = new RelativeLayout(this); | |
var layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FillParent, RelativeLayout.LayoutParams.FillParent); | |
AddContentView (viewContainer, layoutParams); | |
var btn = new Button(this) { Text = "Centered" }; | |
var btnParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.WrapContent); | |
btnParams.AddRule (LayoutRules.CenterInParent); | |
viewContainer.AddView (btn, btnParams); |
NewerOlder