From 52bfdaea11ec4ff5a8bc9b97fb86a2777b8b4511 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sun, 1 Aug 2021 20:25:28 +0200 Subject: new post --- ...-love-and-hate-relationship-with-nodejs copy.md | 43 --- ...30-my-love-and-hate-relationship-with-nodejs.md | 43 +++ ...from-internet-consumer-to-full-hominum-again.md | 36 -- ...from-internet-consumer-to-full-hominum-again.md | 36 ++ posts/2021-08-01-linux-cheatsheet.md | 364 +++++++++++++++++++++ 5 files changed, 443 insertions(+), 79 deletions(-) delete mode 100644 posts/2020-03-30-my-love-and-hate-relationship-with-nodejs copy.md create mode 100644 posts/2020-03-30-my-love-and-hate-relationship-with-nodejs.md delete mode 100644 posts/2021-07-30- from-internet-consumer-to-full-hominum-again.md create mode 100644 posts/2021-07-30-from-internet-consumer-to-full-hominum-again.md create mode 100644 posts/2021-08-01-linux-cheatsheet.md diff --git a/posts/2020-03-30-my-love-and-hate-relationship-with-nodejs copy.md b/posts/2020-03-30-my-love-and-hate-relationship-with-nodejs copy.md deleted file mode 100644 index b24bacb..0000000 --- a/posts/2020-03-30-my-love-and-hate-relationship-with-nodejs copy.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -Title: My love and hate relationship with Node.js -Description: How I found a way to love and hate Node.js with a passion -Slug: my-love-and-hate-relationship-with-nodejs -Listing: true -Created: 2020-03-30 -Tags: [] ---- - -Previous project I was working on was being coded in [Golang](https://golang.org/). Also was my first project using it. And damn, that was an awesome experience. The whole thing is just superb. From how errors are handled. The C-like way you handle compiling. The way the language is structured making it incredibly versatile and easy to learn. - -It may cause some pain for somebody that is not used of using interfaces to map JSON and doing the recompilation all the time. But we have tools like [entr](http://eradman.com/entrproject/) and [make](https://www.gnu.org/software/make/) to fix that. - -But we are not here to talk about my undying love for **Golang**. Only in some way we probably should. It is an excellent example of how modern language should be designed. And because I have used it extensively in the last couple of years this probably taints my views of other languages. And is doing me a great disservice. Nevertheless, here we are. - -About two years ago I started flirting with [Node.js](https://nodejs.org/en/) for a project I started working on. What I wanted was to have things written in a language that is widely used, and we could get additional developers for. As much as **Golang** is amazing it's really hard to get developers for it. Even now. And after playing around with it for a week I felt in love with the speed of iteration and massive package ecosystem. Do you want SSO? You got it! Do you want some esoteric library for something? There is a strong chance somebody wrote it. It is so extensive that you find yourself evaluating packages based on **GitHub stars** and number of contributors. You get swallowed by the vanity metrics and that potentially will become the downfall of Node.js. - -Because of the sheer amount of choice I often got anxiety when choosing libraries. Will I choose the correct one? Is this library something that will be supported for a foreseeable future or not? I am used of using libraries that are being in development for 10 years plus (Python, C) and that gave me some sort of comfort. And it is probably unfair to Node.js and community to expect same dedication. - -Moving forward ... Work started and things were great. **Speed of iteration was insane**. For some feature that I would need a day in Golang only took me hour or two. I became lazy! Using packages all over the place. Falling into the same trap as others. Packages on top of packages. And [npm](https://www.npmjs.com/) didn't help at all. The way that the package manager works is just horrendous. And not allowing to have node_modules outside the project is also the stupidest idea ever. - -So at that point I started feeling the technical debt that comes with Node.js and the whole ecosystem. What nobody tells you is that **structuring large Node.js apps** is more problematic than one would think. And going microservice for every single thing is also a bad idea. The amount of networking you introduce with that approach always ends up being a pain in the ass. And I don't even want to go into system administration here. The overhead is insane. Package-lock.json made many days feel like living hell for me. And I would eat the cost of all this if it meant for better development experience. Well, it didn't. - -The **lack of Typescript** support in the interpreter is still mind boggling to me. Why haven't they added native support yet for this is beyond me?! That would have solved so many problems. Lack of type safety became a problem somewhere in the middle of the project where the codebase was sufficiently large enough to present problems. We started adding arguments to functions and there was **no way to implicitly define argument types**. And because at that point there were a lot of functions, it became impossible to know what each one accepts, development became more and more trial and error based. - -I tried **implementing Typescript**, but that would present a large refactor that we were not willing to do at that point. The benefits were not enough. I also tried [Flow - static type checker](https://flow.org/) but implementation was also horrible. What Typescript and Flow forces you is to have src folder and then **transpile** your code into dist folder and run it with node. WTH is that all about. Why can't this be done in memory or some virtual file system? Why? I see no reason why this couldn't be done like this. But it is what it is. I abandoned all hope for static type checking. - -One of the problems that resulted from not having interfaces or types was inability to model out our data from **Elasticsearch**. I could have done a **pedestrian implementation** of it, but there must be a better way of doing this without resorting to some hack basically. Or maybe I haven't found a solution, which is also a possibility. I have looked, though. No juice! - -**Error handling?** Is that a joke? - -Thank god for **await/async**. Without it, I would have probably just abandoned the whole thing and went with something else like Python. That's all I am going to say about this :) - -I started asking myself a question if Node.js is actually ready to be used in a **large scale applications**? And this was a totally wrong question. What I should have been asking myself was, how to use Node.js in large scale application. And you don't get this in **marketing material** for Express or Koa etc. They never tell you this. Making Node.js scale on infrastructure or in codebase is really **more of an art than a science**. And just like with the whole JavaScript ecosystem: -- impossible to master, -- half of your time you work on your tooling, -- just accept transpilers that convert one code into another (holly smokes), -- error handling is a joke, -- standards? What standards? - -But on the other hand. As I did, you will also learn to love it. Learn to use it quickly and do impossible things in crazy limited time. - -I hate to admit it. But I love Node.js. Dammit, I love it :) diff --git a/posts/2020-03-30-my-love-and-hate-relationship-with-nodejs.md b/posts/2020-03-30-my-love-and-hate-relationship-with-nodejs.md new file mode 100644 index 0000000..b24bacb --- /dev/null +++ b/posts/2020-03-30-my-love-and-hate-relationship-with-nodejs.md @@ -0,0 +1,43 @@ +--- +Title: My love and hate relationship with Node.js +Description: How I found a way to love and hate Node.js with a passion +Slug: my-love-and-hate-relationship-with-nodejs +Listing: true +Created: 2020-03-30 +Tags: [] +--- + +Previous project I was working on was being coded in [Golang](https://golang.org/). Also was my first project using it. And damn, that was an awesome experience. The whole thing is just superb. From how errors are handled. The C-like way you handle compiling. The way the language is structured making it incredibly versatile and easy to learn. + +It may cause some pain for somebody that is not used of using interfaces to map JSON and doing the recompilation all the time. But we have tools like [entr](http://eradman.com/entrproject/) and [make](https://www.gnu.org/software/make/) to fix that. + +But we are not here to talk about my undying love for **Golang**. Only in some way we probably should. It is an excellent example of how modern language should be designed. And because I have used it extensively in the last couple of years this probably taints my views of other languages. And is doing me a great disservice. Nevertheless, here we are. + +About two years ago I started flirting with [Node.js](https://nodejs.org/en/) for a project I started working on. What I wanted was to have things written in a language that is widely used, and we could get additional developers for. As much as **Golang** is amazing it's really hard to get developers for it. Even now. And after playing around with it for a week I felt in love with the speed of iteration and massive package ecosystem. Do you want SSO? You got it! Do you want some esoteric library for something? There is a strong chance somebody wrote it. It is so extensive that you find yourself evaluating packages based on **GitHub stars** and number of contributors. You get swallowed by the vanity metrics and that potentially will become the downfall of Node.js. + +Because of the sheer amount of choice I often got anxiety when choosing libraries. Will I choose the correct one? Is this library something that will be supported for a foreseeable future or not? I am used of using libraries that are being in development for 10 years plus (Python, C) and that gave me some sort of comfort. And it is probably unfair to Node.js and community to expect same dedication. + +Moving forward ... Work started and things were great. **Speed of iteration was insane**. For some feature that I would need a day in Golang only took me hour or two. I became lazy! Using packages all over the place. Falling into the same trap as others. Packages on top of packages. And [npm](https://www.npmjs.com/) didn't help at all. The way that the package manager works is just horrendous. And not allowing to have node_modules outside the project is also the stupidest idea ever. + +So at that point I started feeling the technical debt that comes with Node.js and the whole ecosystem. What nobody tells you is that **structuring large Node.js apps** is more problematic than one would think. And going microservice for every single thing is also a bad idea. The amount of networking you introduce with that approach always ends up being a pain in the ass. And I don't even want to go into system administration here. The overhead is insane. Package-lock.json made many days feel like living hell for me. And I would eat the cost of all this if it meant for better development experience. Well, it didn't. + +The **lack of Typescript** support in the interpreter is still mind boggling to me. Why haven't they added native support yet for this is beyond me?! That would have solved so many problems. Lack of type safety became a problem somewhere in the middle of the project where the codebase was sufficiently large enough to present problems. We started adding arguments to functions and there was **no way to implicitly define argument types**. And because at that point there were a lot of functions, it became impossible to know what each one accepts, development became more and more trial and error based. + +I tried **implementing Typescript**, but that would present a large refactor that we were not willing to do at that point. The benefits were not enough. I also tried [Flow - static type checker](https://flow.org/) but implementation was also horrible. What Typescript and Flow forces you is to have src folder and then **transpile** your code into dist folder and run it with node. WTH is that all about. Why can't this be done in memory or some virtual file system? Why? I see no reason why this couldn't be done like this. But it is what it is. I abandoned all hope for static type checking. + +One of the problems that resulted from not having interfaces or types was inability to model out our data from **Elasticsearch**. I could have done a **pedestrian implementation** of it, but there must be a better way of doing this without resorting to some hack basically. Or maybe I haven't found a solution, which is also a possibility. I have looked, though. No juice! + +**Error handling?** Is that a joke? + +Thank god for **await/async**. Without it, I would have probably just abandoned the whole thing and went with something else like Python. That's all I am going to say about this :) + +I started asking myself a question if Node.js is actually ready to be used in a **large scale applications**? And this was a totally wrong question. What I should have been asking myself was, how to use Node.js in large scale application. And you don't get this in **marketing material** for Express or Koa etc. They never tell you this. Making Node.js scale on infrastructure or in codebase is really **more of an art than a science**. And just like with the whole JavaScript ecosystem: +- impossible to master, +- half of your time you work on your tooling, +- just accept transpilers that convert one code into another (holly smokes), +- error handling is a joke, +- standards? What standards? + +But on the other hand. As I did, you will also learn to love it. Learn to use it quickly and do impossible things in crazy limited time. + +I hate to admit it. But I love Node.js. Dammit, I love it :) diff --git a/posts/2021-07-30- from-internet-consumer-to-full-hominum-again.md b/posts/2021-07-30- from-internet-consumer-to-full-hominum-again.md deleted file mode 100644 index 97691de..0000000 --- a/posts/2021-07-30- from-internet-consumer-to-full-hominum-again.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -Title: My journey from being an internet über consumer to being a full hominum again -Description: My journey from being an internet über consumer to being a full hominum again -Slug: from-internet-consumer-to-full-hominum-again -Listing: true -Created: 2021-07-30 -Tags: [] ---- - -It's been almost a year since I started purging all my online accounts and going down this rabbit hole of being almost independent of the current internet machine. Even though I initially thought that I will have problems adapting, I was pleasantly surprised that the transition went so smoothly. Even better, it brought many benefits to my life. Such as increased focus, less stress about trivial things, etc. - -It all started with me doing small changes like unsubscribing from emails that I have either subscribed to by accepting terms and conditions. Or even some more malicious emails that I was getting because I was on a shared mailing list. And the later ones I hate the most of all. How the hell do they keep sharing my email and sending me unsolicited emails and get away with it? I have a suspicion that these marketing people share an Excel file between them and keep resubscribing me when they import lists into Mailchimp or similar software. - -It's fascinating to see how much crap you get subscribed to when you are not paying attention. It got so bad that my primary Gmail address is a full of junk and need constant monitoring and cleaning up. And because I want to have Inbox Zero, this presents an additional problem for me. - -The stress that email presented for me didn't occur to me for a long time. I was noticing that I was unable to go through one single hour without hysterically refreshing email. And if somebody wrote me something, I needed to see it right then, even though I didn't immediately reply to it. I can only describe this with FOMO (fear of missing out). I have no other explanation than that. It was crippling, and I was constantly context switching, which I will address further down this post in more details. - -This was one of the reasons why I spawned up my personal email server, and I am using it now as my primary and person email. I still have Gmail as my “junk” email that I use for throw away stuff. I log in to Gmail once a week and check if there are any important emails that I got, but apart from that, it's sitting dormant and collecting dust. - -The more I was watching the world loose it's self with allowing anti freedom things to happen to it, the more I started to realize that something has to change. I don't have the power to change the world. And I also don't have a grandiose opinion of myself to even think to try it. But what I can do is to not subscribe to this consumer way of thinking. I will not be complicit in this. My moral and ethical stances won't allow it. So, this brings us to the second part of my journey. - -I was using all these 3rd party services because I was either lazy or OK with the drawbacks of them. I watched these services and companies became more and more evil. It is evil if you sell your user's data in this manner. Nobody reads privacy policies and everybody is OK with accepting them, and they pray on that flaw in human nature. I really hate the hypocrisy they manage to muster. These companies prey on our laziness, and we are at fault here. Nobody else. And I truly understand the reasons why we rather accept and move on, and not object and have our lives a little more difficult. They have perfected this through years of small changes that make us a little more dependent on them. You could not convince a person to give away all his rights and data in one day. This was gradual and slow. And it caught us all in surprise. When I really stopped and thought about it, I felt repulsed. By really stopping and thinking about it, I really mean stopping and thinking about it. Thoroughly and in depth. - -Each step I took depleted my character a bit more. Like I was trading myself bit by bit without understanding what it all meant. What it meant to be a full person, not divided by all this bought attention they want from me. They don't just get your data, but they also take your attention away from you. They scatter your and go with the divide and conquer tactic from there. And a person divided is a person not fully there. Not at the moment. Not alive fully. - -I was unable to form long thoughts. Well, I thought I was. But now that I see what being a full person is again, I can see that I was not at my 100% back then. - -A revolt was inevitable. There was no other way of continuing my story without it. Without taking back my attention, my thoughts, my time, and my privacy, regardless of how too late it maybe is. - -This has nothing to do with conspiracy theories. Even less with changing the world. All I wanted was to get my life back in order and not waste the energy that could be spent in other, better places. - -I started reading more. I can focus now fully on things I work on. Furthermore, I have the mental acuity that I never had before. My mind feels sharp. I don't get angry so much. I can cherish the finer things in life now without the need to interpret them intellectually. Not only that, but I have a feeling of belonging again. Sense of purpose has returned with a vengeance. And I can now help people without depleting myself. - -The last step so far was to finish closing all the remaining online accounts that I still had. And when I was thinking what value they bring me, I wasn't surprised that the answer was none. I wasn't logging in them and using them. I stopped being afraid of FOMO. If somebody wants to get in contact me, they will find a way. I am one search away. - -We are not beholden to anybody. Our lives are our own. So dare yourself to delete Facebook, LinkedIn. To unsubscribe. Dare yourself to take your time and attention back. Use that time and energy to go for a walk without thinking about work. Read a book instead of reading comment on social media that you will forget in an hour. Enrich your life instead of wasting it. It only requires a small step. And you will feel the benefits immediately. Lose the weight of the world that is crushing you without your consent. diff --git a/posts/2021-07-30-from-internet-consumer-to-full-hominum-again.md b/posts/2021-07-30-from-internet-consumer-to-full-hominum-again.md new file mode 100644 index 0000000..97691de --- /dev/null +++ b/posts/2021-07-30-from-internet-consumer-to-full-hominum-again.md @@ -0,0 +1,36 @@ +--- +Title: My journey from being an internet über consumer to being a full hominum again +Description: My journey from being an internet über consumer to being a full hominum again +Slug: from-internet-consumer-to-full-hominum-again +Listing: true +Created: 2021-07-30 +Tags: [] +--- + +It's been almost a year since I started purging all my online accounts and going down this rabbit hole of being almost independent of the current internet machine. Even though I initially thought that I will have problems adapting, I was pleasantly surprised that the transition went so smoothly. Even better, it brought many benefits to my life. Such as increased focus, less stress about trivial things, etc. + +It all started with me doing small changes like unsubscribing from emails that I have either subscribed to by accepting terms and conditions. Or even some more malicious emails that I was getting because I was on a shared mailing list. And the later ones I hate the most of all. How the hell do they keep sharing my email and sending me unsolicited emails and get away with it? I have a suspicion that these marketing people share an Excel file between them and keep resubscribing me when they import lists into Mailchimp or similar software. + +It's fascinating to see how much crap you get subscribed to when you are not paying attention. It got so bad that my primary Gmail address is a full of junk and need constant monitoring and cleaning up. And because I want to have Inbox Zero, this presents an additional problem for me. + +The stress that email presented for me didn't occur to me for a long time. I was noticing that I was unable to go through one single hour without hysterically refreshing email. And if somebody wrote me something, I needed to see it right then, even though I didn't immediately reply to it. I can only describe this with FOMO (fear of missing out). I have no other explanation than that. It was crippling, and I was constantly context switching, which I will address further down this post in more details. + +This was one of the reasons why I spawned up my personal email server, and I am using it now as my primary and person email. I still have Gmail as my “junk” email that I use for throw away stuff. I log in to Gmail once a week and check if there are any important emails that I got, but apart from that, it's sitting dormant and collecting dust. + +The more I was watching the world loose it's self with allowing anti freedom things to happen to it, the more I started to realize that something has to change. I don't have the power to change the world. And I also don't have a grandiose opinion of myself to even think to try it. But what I can do is to not subscribe to this consumer way of thinking. I will not be complicit in this. My moral and ethical stances won't allow it. So, this brings us to the second part of my journey. + +I was using all these 3rd party services because I was either lazy or OK with the drawbacks of them. I watched these services and companies became more and more evil. It is evil if you sell your user's data in this manner. Nobody reads privacy policies and everybody is OK with accepting them, and they pray on that flaw in human nature. I really hate the hypocrisy they manage to muster. These companies prey on our laziness, and we are at fault here. Nobody else. And I truly understand the reasons why we rather accept and move on, and not object and have our lives a little more difficult. They have perfected this through years of small changes that make us a little more dependent on them. You could not convince a person to give away all his rights and data in one day. This was gradual and slow. And it caught us all in surprise. When I really stopped and thought about it, I felt repulsed. By really stopping and thinking about it, I really mean stopping and thinking about it. Thoroughly and in depth. + +Each step I took depleted my character a bit more. Like I was trading myself bit by bit without understanding what it all meant. What it meant to be a full person, not divided by all this bought attention they want from me. They don't just get your data, but they also take your attention away from you. They scatter your and go with the divide and conquer tactic from there. And a person divided is a person not fully there. Not at the moment. Not alive fully. + +I was unable to form long thoughts. Well, I thought I was. But now that I see what being a full person is again, I can see that I was not at my 100% back then. + +A revolt was inevitable. There was no other way of continuing my story without it. Without taking back my attention, my thoughts, my time, and my privacy, regardless of how too late it maybe is. + +This has nothing to do with conspiracy theories. Even less with changing the world. All I wanted was to get my life back in order and not waste the energy that could be spent in other, better places. + +I started reading more. I can focus now fully on things I work on. Furthermore, I have the mental acuity that I never had before. My mind feels sharp. I don't get angry so much. I can cherish the finer things in life now without the need to interpret them intellectually. Not only that, but I have a feeling of belonging again. Sense of purpose has returned with a vengeance. And I can now help people without depleting myself. + +The last step so far was to finish closing all the remaining online accounts that I still had. And when I was thinking what value they bring me, I wasn't surprised that the answer was none. I wasn't logging in them and using them. I stopped being afraid of FOMO. If somebody wants to get in contact me, they will find a way. I am one search away. + +We are not beholden to anybody. Our lives are our own. So dare yourself to delete Facebook, LinkedIn. To unsubscribe. Dare yourself to take your time and attention back. Use that time and energy to go for a walk without thinking about work. Read a book instead of reading comment on social media that you will forget in an hour. Enrich your life instead of wasting it. It only requires a small step. And you will feel the benefits immediately. Lose the weight of the world that is crushing you without your consent. diff --git a/posts/2021-08-01-linux-cheatsheet.md b/posts/2021-08-01-linux-cheatsheet.md new file mode 100644 index 0000000..6e28016 --- /dev/null +++ b/posts/2021-08-01-linux-cheatsheet.md @@ -0,0 +1,364 @@ +--- +Title: List of essential Linux commands for server management +Description: List of essential Linux commands for server management +Slug: linux-cheatsheet +Listing: true +Created: 2021-08-01 +Tags: [] +--- + +***For Debian and Ubuntu servers*** + + + + + +##### Generate SSH key + +```bash +ssh-keygen -t ed25519 -C "your_email@example.com" + +# when no support for Ed25519 present +ssh-keygen -t rsa -b 4096 -C "your_email@example.com" +``` + +Note: By default SSH keys get stored to `/home//.ssh/` folder. + + + +##### Login to host via SSH + +```bash +# connect to host as your local username +ssh host + +# connect to host as user +ssh @ + +# connect to host using port +ssh -p @ +``` + + + +##### Execute command on a server through SSH + +```bash +# execute one command +ssh root@100.100.100.100 "ls /root" + +# execute many commands +ssh root@100.100.100.100 "cd /root;touch file.txt" +``` + + + +##### Displays currently logged in users in the system + +```bash +w +``` + + + +##### Displays Linux system information + +```bash +uname +``` + + + +##### Displays kernel release information + +```bash +uname -r +``` + + + +##### Shows the system hostname + +```bash +hostname +``` + + + +##### Shows system reboot history + +```bash +last reboot +``` + + + +##### Displays information about the user + +```bash +sudo apt install finger +finger +``` + + + +##### Displays IP addresses and all the network interfaces + +```bash +ip addr show +``` + + + +##### Downloads a file from an online source + +```bash +wget https://example.com/example.tgz +``` + +Note: If URL contains ?, & enclose the URL in double quotes. + + + +##### Compress a file with gzip + +```bash +# will not keep the original file +gzip file.txt + +# will keep the original file +gzip --keep file.txt +``` + + + +##### Interactive disk usage analyzer + +```bash +sudo apt install ncdu + +ncdu +ncdu +``` + + + +##### Install Node.js using the Node Version Manager + +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash +source ~/.bashrc + +nvm install v13 +``` + + + +##### Too long; didn't read + +```bash +npm install -g tldr + +tldr tar +``` + + + +##### Combine all Nginx access logs to one big log file + +```bash +zcat -f /var/log/nginx/access.log* > /var/log/nginx/access-all.log +``` + + + +##### Set up Redis server + +```bash +sudo apt install redis-server redis-tools + +# check if server is running +sudo service redis status + +# set and get a key value +redis-cli set mykey myvalue +redis-cli get mykey + +# interactive shell +redis-cli +``` + + + +##### Generate statistics of your webserver + +```bash +sudo apt install goaccess + +# check if installed +goaccess -v + +# combine logs +zcat -f /var/log/nginx/access.log* > /var/log/nginx/access-all.log + +# export to single html +goaccess \ + --log-file=/var/log/nginx/access-all.log \ + --log-format=COMBINED \ + --exclude-ip=0.0.0.0 \ + --ignore-crawlers \ + --real-os \ + --output=/var/www/html/stats.html + +# cleanup afterwards +rm /var/log/nginx/access-all.log +``` + + + +##### Search for a given pattern in files + +```bash +grep -r ‘pattern’ files +``` + + + +##### Find proccess ID for a specific program + +```bash +pgrep nginx +``` + + + +##### Print name of current/working directory + +```bash +pwd +``` + + + +##### Creates a blank new file + +```bash +touch newfile.txt +``` + + + +##### Displays first lines in a file + +```bash +# -n presents the number of lines (10 by default) +head -n 20 somefile.txt +``` + + + +##### Displays last lines in a file + +```bash +# -n presents the number of lines (10 by default) +tail -n 20 somefile.txt + +# -f follows the changes in file (doesn't closes) +tail -f somefile.txt +``` + + + +##### Count lines in a file + +```bash +wc -l somefile.txt +``` + + + +##### Find all instances of the file + +```bash +sudo apt install mlocate + +locate somefile.txt +``` + + + +##### Find file names that begin with ‘index’ in /home folder + +```bash +find /home/ -name "index" +``` + + + +##### Find files larger than 100MB in the home folder + +```bash +find /home -size +10000M +``` + + + +##### Displays block devices related information + +```bash +lsblk +``` + + + +##### Displays free space on mounted systems + +```bash +df -h +``` + + + +##### Displays free and used memory in the system + +```bash +free -h +``` + + + +##### Displays all active listening ports + +```bash +sudo apt install net-tools + +netstat -pnltu +``` + + + +##### Kill a process violently + +```bash +kill -9 +``` + + + +##### List files opened by user + +```bash +lsof -u +``` + + + +##### Execute "df -h", showing periodic updates + +```bash +# -n 1 means every second +watch -n 1 df -h +``` + + + -- cgit v1.2.3