When copying a large file on Linux transfer hangs at the end… And you want to f**king kill someone.

There’s an annoying bug in almost every Linux distribution I’ve worked with. When your copying a large file to usb device (pendrive etc.) it hangs at the end (I mean it haaaaaaaaaaaaangs).

I’ve found a solution that works on Elementary and Ubuntu (at least).

Simply paste this two commands in your terminal:

sudo sh -c 'echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes'
sudo sh -c 'echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes'

Add this to some kind of startup script and forget about transfer problems…

How to unfreeze KDE’s plasmashell?

I’m using Debian 9.4 and this freaking KDE5 is freezing very often! What you can do when your desktop stops responding? Restart computer? Use ALT+CTRL+F1…12? Nah! There’s a better solution!

Simply edit your  ~/.bash_aliases:

nano ~/.bash_aliases

And append to it:

alias restart-plasma='kquitapp5 plasmashell && kstart plasmashell'

Now whenever your plasma desktop starts trolling you, go to your console and type restart-plasma voilàDezombified!

PS. Use tilda to open console in every shitty situation you’ll get into! Simply press F12 and you’ll get nice Quake like terminal.

Feel like a ninja
Feel like a Linux ninja

Permission denied when script is trying to execute ps_files_cleanup_dir

This is pretty common problem. I’ve encountered it on recent version of the Debian operating system. When you see something like that:

Notice:  session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5/sessions) failed: Permission denied (13) in /mnt/www-data/htdocs/raportMNW/inc/bryanjhv/slim-session/src/Slim/Middleware/Session.php on line 110

You can fix that easily with following Linux commands:

sudo nano /etc/php5/apache2/php.ini

Now use CTRL+W to find following string session.save_path and configure it like that:

session.save_path = "/tmp"

Save your file using CTRL+X and restart Apache2 service:

sudo service apache2 restart

And voilà!