Skip to content

Instantly share code, notes, and snippets.

View gladx's full-sized avatar
🕺
Coding ...

Ali Yousefi gladx

🕺
Coding ...
View GitHub Profile
sudo passwd username
------------------- hardware info
Battery Info
upower -i /org/freedesktop/UPower/devices/battery_BAT0
acpi -V
less a.txt less is show text file faster than vim or more
more a.txt text editor ?
------------------
how copy folder with content
<?php
// http://ascii-table.com/ansi-escape-sequences.php
// http://ascii-table.com/ansi-escape-sequences-vt-100.php
// "\033[?25l" Hide the cursor.
// "\033[?25h" Show the cursor.
// "\033[K" Delete everything from the cursor to the end of the line.
// echo '1-Start Line', "\n";
@gladx
gladx / human_filesize.php
Last active April 8, 2021 12:30
Human readable file size in php
<?php
// http://jeffreysambells.com/2012/10/25/human-readable-filesize-php + some edit
// https://gist.github.com/liunian/9338301
function human_filesize($bytes, $decimals = 2)
{
if ($bytes < 1024) {
return $bytes . ' B';
}
$factor = floor(log($bytes, 1024));