Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal
.
sudo journalctl --disk-usage
- Active journal files will be marked as archived, so that they are never written to in future.
Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal
.
sudo journalctl --disk-usage
func getAllFilenames(fs *embed.FS, path string) (out []string, err error) { | |
if len(path) == 0 { | |
path = "." | |
} | |
entries, err := fs.ReadDir(path) | |
if err != nil { | |
return nil, err | |
} | |
for _, entry := range entries { | |
fp := filepath.Join(path, entry.Name()) |
opendb () { | |
[ ! -f .env ] && { echo "No .env file found."; exit 1; } | |
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) |
<?php | |
Artisan::command('db:open {connection?}', function ($connection = null) { | |
if (! file_exists('/Applications/TablePlus.app')) { | |
$this->warn('This command uses TablePlus, are you sure it\'s installed?'); | |
$this->line("Install here: https://tableplus.com/\n"); | |
} | |
$driver = $connection ?: config('database.default'); | |
$host = config("database.connections.{$driver}.host"); |
var myFlagType string | |
func init() { | |
const ( | |
flagValue = "default value is foo" | |
flagUsage = "this is my flag explanation" | |
) | |
flag.StringVar(&myFlagType, "foo", flagValue, flagUsage) | |
flag.StringVar(&myFlagType, "f", flagValue, flagUsage+" (shorthand)") | |
flag.Parse() |
tail -f -n 450 storage/logs/laravel*.log \ | |
| grep -i -E \ | |
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \ | |
--color |
package network | |
import ( | |
"errors" | |
"net" | |
) | |
// LocalIP get the host machine local IP address | |
func LocalIP() (net.IP, error) { | |
ifaces, err := net.Interfaces() |
package main | |
import ( | |
"math" | |
"fmt" | |
) | |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
//::: ::: | |
//::: This routine calculates the distance between two points (given the ::: |
#! /usr/bin/env bash | |
# Install any build dependencies needed for curl | |
sudo apt-get build-dep curl | |
# Get latest (as of Feb 25, 2016) libcurl | |
mkdir ~/curl | |
cd ~/curl | |
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2 | |
tar -xvjf curl-7.50.2.tar.bz2 |
<?php | |
namespace App\Http\Controllers\Web; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
class StaticController extends Controller |