[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Save me time
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 18
Thread images: 1
File: high-level-programming.png (47 KB, 864x542) Image search: [Google]
high-level-programming.png
47 KB, 864x542
ITT: post daily-task automation scripts or ideas for automation scripts.
>>
>>55448761
alias update='sudo pacman -Syyu && pacaur -u'


extract() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjpf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar e $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' is not an archive covered by this function"
esac
else
echo "'$1' is not a valid file"
fi
}


Some ones I use
>>
>>55449111
Noice
>>
>>55449111
Damn, the second one is pretty good
>>
>>55449111
Why not just pacaur -Syu?
>>
>>55449403
Thanks for pointing that out
>>
tinkering in Google Apps Script
>>
ls that shows octal permissions (for sunos)

clear;(pwd;ls -lrteh | nawk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) *2^(8-i));if(k)printf("%0o ",k);print}')|less -FR
>>
>>55449111
Please use atool instead of this extract shit.
>>
>>55449111
~/.interjection
-----------------
I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!

And then
~/.bashrc
-------------
alias linux="cat ~/.interject | xclip -selection c
>>
>>55450663
same shit for leenoocs

clear;(pwd;ls -lrth | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) *2^(8-i));if(k)printf("%0o ",k);print}')|more
>>
alias ocean='play -n -n --combine merge synth pinknoise band -n 1200 1800 tremolo 50 10 tremolo 0.14 70 tremolo 0.2 50'

optimize() {
for f in "$@"; do
case "$f" in
*gif) gifsicle -bO3 "$f";;
*png) optipng -o 6 -strip all "$f";;
*jpg) jpegoptim --strip-all "$f";;
*) printf "Error: Something happened.\n"
return 1
esac
done
}
>>
alias pacman = 'yaourt'
alias update = 'pacman -Syyua'
>>
>>55448761
>entire thread is linux shit

well this is useless
>>
>>55452595
what the fuck else could OP mean?
>>
>>55452616
i use hundreds of automation scripts on windows.

@echo off

setlocal enabledelayedexpansion

set groupsize=2000
set n=1
set nf=0

for %%f in (*.*) do (
if !n!==1 (
set /a nf+=1
md 00!nf!
)

move /Y "%%f" 00!nf!

if !n!==!groupsize! (
set n=1
) else (
set /A n+=1
)
)
endlocal
>>
>>55452687
@echo off

cd /d %~dp1

set /p f= Folder Name?
mkdir "%f%"
set newpath="%f%"

:loop
if {%1}=={} goto :EOF
move %1 %newpath%
shift
goto loop

echo on
>>
>>55452720
@echo off
setlocal EnableDelayedExpansion

for /r %%x in (*.*) do (
move "%%x" "%%x"/../..
)

for /f %%i in ('dir /b "%cd%\*.*"') do (
for /d %%d in (*) do rd "%%~d"
)
Thread replies: 18
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.