Skip to content

Instantly share code, notes, and snippets.

View joostvanveen's full-sized avatar

Joost van Veen joostvanveen

View GitHub Profile
@joostvanveen
joostvanveen / linux_find_size_modified_date_and_remove_files.sh
Last active September 6, 2022 14:53
Linux commands to find all files modified older than a certain date or time, remove, find largest files or folder in a human readable way.
## NOTE: when finding file by time, use one of the following flags:
# ctime : the time a file was changed, in hours. On most systems this timestamp cannot be altered by any user, so it is fairly reliable
# atime : the time a file was last accessed, in hours. This is also set by the system.
# mtime : the modified time of a file, in hours. This can be set by any user. So if you are looking for mailcious files, never use this flag.
# cmin : same as mtime, but in minutes.
# amin : same as atime, but in minutes.
# mmin : same as mtime, but in minutes.
# Find all files in current directory changed more than 8 hours ago (480 minutes)
find $PWD -mindepth 1 -type f -cmin +480
@joostvanveen
joostvanveen / du.sh
Last active March 16, 2023 05:44
Get folder sizes on command line, including --max-depth, sorted by folder size desc
# Get available disk space
df -h
# Get the top 10 biggest folders in the current directory
du -h --max-depth=1 | sort -rh | head -10
# Get the top 10 biggest folders in the current directory and their first child directories
du -h --max-depth=2 | sort -rh | head -10
# Get sizes of all folders in the current directory
@barryvdh
barryvdh / _ide_helper.php
Last active April 4, 2024 09:11
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@accentinteractive
accentinteractive / dump_helper.php
Created October 5, 2012 07:09
dump_helper: functions to dump variables to the screen, in a nicley formatted manner
<?php
/**
* Dump helper. Functions to dump variables to the screen, in a nicley formatted manner.
* @author Joost van Veen
* @version 1.0
*/
if (!function_exists('dump')) {
function dump ($var, $label = 'Dump', $echo = TRUE)
{
// Store dump in variable
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.