Skip to content

Instantly share code, notes, and snippets.

aws s3api list-objects --bucket [BUCKET NAME] --output json --query 'Contents[].{Key: Key, Size: Size}' > objects_with_size.json
cat objects_with_size.json | jq -r '.[] | [.Key,.Size] | @csv' > objects_with_size.csv
@jiminald
jiminald / find-and-delete.sh
Last active May 16, 2022 11:37
Find sync-conflict files
find . -name "*sync-conflict*" -print -exec rm -rf {} \;
#!/bin/bash
echo Updating apt
sudo apt update
sudo apt upgrade -y
echo Installing Docksal
bash <(curl -fsSL https://get.docksal.io)
echo "DOCKSAL_VHOST_PROXY_IP=0.0.0.0" >> ~/.docksal/docksal.env
# Replace 23 with the line number your looking for
for file in $(grep -r -I -l .); do
awk 'FNR==23 {print FILENAME, $0}' "$file" >> ./output.txt;
done
using System.Threading.Tasks;
using HomeAssistant.AppStarter;
using HomeAssistant.AppStarter.Models.Events;
using HomeAssistant.AppStarter.WebServices;
using NLog;
namespace HassLab.Console.HassApps
{
public class WakeUpApp : IHassApp
{
@jiminald
jiminald / find-within.sh
Last active May 6, 2016 10:21
Find within files
find ./ -name "*.ext" -exec grep -iH "search terms" {} \;
@jiminald
jiminald / position.php
Created May 5, 2013 15:07
Track an individual using Google Latitude, depending on times and days
<?php
/**
* This lets you track an individual using Google Latitude depending on the hour of the day, days in a week and months.
*
* How to get your Google ID
* =========================
* Go to : https://latitude.google.com/latitude/b/0/apps
* Click "Enable and show best available location" and Save
* In the text area, copy the ID from the URL, for example:
* http://latitude.google.com/latitude/apps/badge/api?user=<GOOGLE ID>&type=iframe&maptype=roadmap&hl=en-GB
@jiminald
jiminald / mount.nfs2ramfs
Created December 2, 2012 00:47
Mount NFS to RAMFS for sharing multiple locations on one SAMBA Share
#!/bin/bash
SERVER=$1
NFS_SHARE=$2
LOCAL_SHARE=$3
RAMFS_SHARE=$4
echo "Setting up RamFS"
mkdir /tmp/ramfs
mkdir /tmp/ramfs/$RAMFS_SHARE
@jiminald
jiminald / CleanDesktop.cmd
Created April 22, 2012 03:49
Cleans the Users desktop to a preset folder. As the desktop is loaded when the machine is started, it preloads its content, this moves the user data into the my documents so PC bootup time is faster.
REM ==== Windows XP ====
cd "C:\Documents and Settings\User\Desktop"
mkdir "C:\Documents and Settings\User\My Documents\Desktop"
for /r %%x in (.,^) do move /Y "%%x" "C:\Documents and Settings\User\My Documents\Desktop"
REM ==== Windows Vista, 7, + ====
cd "C:\Users\User\Desktop"
mkdir "C:\Users\User\Documents\Desktop"
for /r %%x in (.,^) do move /Y "%%x" "C:\Users\User\Documents\Desktop"
@jiminald
jiminald / gist:1756076
Created February 7, 2012 00:10
Tree command in Linux
#!/bin/sh
#######################################################
# UNIX TREE #
# Version: 2.3 #
# File: ~/apps/tree/tree.sh #
# #
# Displays Structure of Directory Hierarchy #
# ------------------------------------------------- #
# This tiny script uses "ls", "grep", and "sed" #
# in a single command to show the nesting of #