Lately I have been doing some of the processes/workflow automation at work, and I have figured that I can put together some of the common python code snippets and references that I had repeatedly used across multiple projects related to text/file processing.
When you are working with the text files it is obvious that the file path is required for the python to script to locate the file. For this you can use pathlib
library. The pathlib library is included in all python versions >= 3.4.
A small snippet how to import and use the pathlib to store a file…
How to.
Sometimes I get really surprised at where does my time and days go and here is one example.
Yesterday evening I decided that I needed to share a folder on my macOS so that the Kali Linux 2020 VM can have access to it. The vm was created in VMWare Fusion, so it makes sense to look for sharing feature in the VM settings.
This is how it looks like after I added a folder and called it kalish and checked the checkmark Enable Shared Folders.
It also warns us about VMware Tools.
You will need to use Print Working Directory command, which is:
pwd
You will need to use Change Directory command, which is:
cd directoryname
You will have to provide either the absolute or relative path to the directory.
It can get pretty tiring navigating with absolute or relative paths all the time, so there are also some shortcuts to this:
.
(the directory you’re currently in)..
(parent directory, eg cd..
).~
(home directory, eg /home/user)-
(takes you to the previous directory you were just at)You will need to use List Directories command:
ls
This does not include hidden…
Here is a neat terminal command which displays a list of all the extensions you have installed:
code --list-extensions
Below is the list of the extensions, which I am either actively using or just interested in trying out, and I hope you, too, will find it useful.
So, the first part concluded with deployment of Prisma, and now it’s time to set up the Apollo Server to run on the backend, and Apollo Client on the FrontEnd.
Let’s start with installing the required dependencies. We’re going to run the npm install command from our backend folder.
npm i apollo-server graphql graphql-import prisma-binding
graphql-import
package is there to help you importing & exporting…A quick HowTo.
venv
is a package shipped with Python 3, which you can run usingpython3 -m venv
(although for some reason some distros separate it out into a separate distro package, such aspython3-venv
on Ubuntu/Debian). It serves the same purpose asvirtualenv
, but only has a subset of its features (see a comparison here). — source
I use it mainly for two reasons:
We can think of it as if the project would live on its own island, isolated from the rest of the world…
#!/bin/bash # # Kali Docker Setup Script # @decidedlygray 20180902 # LICENSE: MIT # # Steps taken from: https://docs.docker.com/install/linux/docker-ce/debian/ # And: https://medium.com/@airman604/installing-docker-in-kali-linux-2017-1-fbaa4d1447fe # Install uses the repository, so we can get updates in the future # Remove any existing docker packages and update package list sudo apt remove docker docker-engine docker.io -y sudo apt update # Install apt HTTPS packages sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y # Add Docker GPG key curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - # Verify key exists # sudo apt-key fingerprint…
So, I started to work on my personal portfolio as an aspiring Junior Frontend developer before I switched my career to Security Analyst :D
At my previous job we were building an internal testing tool (top secret stuff), and the stack we used was pretty trendy on the frontend side, it was React with Typescript and other friends.
So, I wanted to develop my skillset further, and on top of that learn a bit of backend, while building a personal project for my portfolio.
I would probably do something with NodeJS, Express, MongoDB and React-Typescript, since I actually wasn’t sure…
A cool thing that I have learned about VSCode Workspaces today is that you can make them different colours. Yes! This cute little feature I found really useful because I often find myself running few instances at the same time.
So this can be achieved in few steps:
Context is well explained in the official React documentation, so I decided to go with rather a practical example.
Everything is unknown until it’s known. Self-learner.