I erroneously deletedy root partition. Now what?

Posted on Reddit’s r/archlinux and r/techsupport.

Is there a way I can reinstall Arch from the bootstick I still have?

I’ve been following this tutorial, and how my system and it differs is that all of my partitions have “unknown filesystems”.

Here’s a backlog:


    error: disk `lvmid/MMwt86-jYqe-hUn1 ... zo7KQw' not found.
    Entering rescue mode...
    grub rescue> ls
    (hd0) (hd1) (hd1,gpt2) (hd1,gpt1)
    grub rescue> ls (hd0)
    (hd0): File-system is unknown.
    grub rescue> set
    cmdpath=(hd1,gpt1)/EFI/grub_uefi
    prefix=(lvmid/MMwt86-jYqe ... zo7KQw)/boot/grub
    root=lvmid/MMwt86-jYqe-hUn1-x1eI-sqCk-RoXD-NihFx4/49zeY2-wEvE-jsN6-2EqG-5TW4-CeLE-zo7KQe
    grub rescue>

And the same error I get for (hd0) applies to the other three ((hd1), (hd1,gpt2), and (hd1,gpt1)).

IMPORTANT NOTE:
(hd1,) is my bootstick. Removing it beforehand results in (hd0) (hd0,gpt2) (hd0,gpt1).


Source link

What am I doing wrong in the RClone `crypt remote` creation process?

So, I’m following along with this video on how to set up rclone, and I was making an encrypted version of my Google Drive remote (google_drive).
However, whenever I do ./rclone copy Test.txt google_drive_crypt it creates a new directory inside the rclone folder called “google_drive” and puts the encoded folder in there. — However, when the person does it in the video it works perfectly fine, putting the file on Google Drive.
What am I doing wrong?

Here’s a (small) command backlog:

[calin@CalinArchLinuxPC rclone-v1.57.0-linux-386]$ ./rclone config
Current remotes:

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n
name> google_drive
Storage> drive

# ...

name> google_drive_crypt
remote> google_drive

Thanks!
Cheers!


Source link

Lack of Motivation

I don’t know about you but I sure lack motivation to work on projects and just get out of bed sometimes, most of us struggle with anxiety, depression and even acute mental disorders, but the one thing that seems to keep us going is a reconnection with the world around us, I want to tell you all a little story of how I found my motivation back.

And by “little story” I really mean it, I didn’t really know it at the time I was just living life as I usually did and then it hit me, the depression and lack of motivation to even get on the computer, being stuck in a cycle of wake up, watch tv, eat and sleep. I found myself stuck in a hole that at the time to be honest I didn’t really care if I came out of that hole or not, however, what changed after the months of depression and anxiety to even leave the house, was a trip I took back home, you see I live in Germany, quite far away from my home in England, and this trip back home did something that changed my whole life that I had been living for months and it opened my eyes and I found new and old passions for things I love and hate, I found new and exciting things to do and I managed to change my life for better.

I know many people out there suffer in even worse conditions maybe even in the same conditions as I did, and my point here is that not everyone is living their lives without anxiety and depression, everyone and I mean EVERYONE, is just as troubled as you.


Source link

Lack of Motivation

I don’t know about you but I sure lack motivation to work on projects and just get out of bed sometimes, most of us struggle with anxiety, depression and even acute mental disorders, but the one thing that seems to keep us going is a reconnection with the world around us, I want to tell you all a little story of how I found my motivation back.

And by “little story” I really mean it, I didn’t really know it at the time I was just living life as I usually did and then it hit me, the depression and lack of motivation to even get on the computer, being stuck in a cycle of wake up, watch tv, eat and sleep. I found myself stuck in a hole that at the time to be honest I didn’t really care if I came out of that hole or not, however, what changed after the months of depression and anxiety to even leave the house, was a trip I took back home, you see I live in Germany, quite far away from my home in England, and this trip back home did something that changed my whole life that I had been living for months and it opened my eyes and I found new and old passions for things I love and hate, I found new and exciting things to do and I managed to change my life for better.

I know many people out there suffer in even worse conditions maybe even in the same conditions as I did, and my point here is that not everyone is living their lives without anxiety and depression, everyone and I mean EVERYONE, is just as troubled as you.


Source link

Can I disable the automatic deferring of module-scripts without the `async` attribute?

So, I read this short article on using ES6 modules in the browser, and it says this:

Scripts of type module are deferred by default. But you can override that behaviour with making them async. (Psst, confused between deferred and async again? Here you go.)

But, I don’t want my script to be deferred OR asynchronous.
So, is it possible I could do something around the lines of:?

<script defer="false" type="module" src="main.js">
</script>

Thanks!
Cheers!


Source link

4 Ways To Be Constantly Improving Your Code

A Follow Helps Everyone

No Really if you follow now, more and better quality content will be published. Also follow medium so you don’t miss out.
See more amazing content here: https://theoverpoweredpc.medium.com
Not much of world’s population is made up of programmers. In fact, only 22.1% of the population are programmers. This might make you think, “How is that possible? How can there be so little programmers but so many programs and apps?,” well at least it got me thinking. If there are so little programmers what could 1 programmer do to make their code be like a team of 100 programmers. There are 4 simple ways to easily improve your code.

  1. Stay Organized

There is no way to describe how important keeping your code in an organized manner is. The organization of your code will give you a much more readable piece of software and it will also be a lot easier to fix bugs and or improve performance. Not only will it be easier to read but it will also be easier to spot out something that seems of or unwanted. When you have more organized code people are more willing to pitch in some ideas too because they will be able to understand what is going on and be able to help if they want to.

Keeping your code organized will also improve the development of your program because it will be easier to find things to edit, add, remove, change, etc. I am not just talking about the code but also the files and the directory’s because that will also help you out when you are trying to find a script that is external that you need to link to your current script.

  1. Read Documentation

I know that reading documentation may not be the funnest thing to do but it can really help you out with a problem or struggle. Say you are trying to connect to a database for say Mongo DB, you are not going to know how to do it instantly by heart. You need to learn how to use the SDK and how to integrate it into your code for your program to work. It also really helps you out when you need help with something for say a tutorial, in our case, on how to connect to Mongo DB and read and write data to it.

  1. Stack Overflow

This may sound ridiculous, but it is not. Stack overflow is a site where people can share information on software and programs of all kinds, and you can also ask a question about a problem that you have and get an answer speedy fast. It may also seem like people do not know what they are doing there but plenty of people out there that got their jobs on stack overflow.

  1. Tools

Using simple tools to help your code is another fantastic way to improve your code. The tools that are out there can help you find and solve bugs, organize, script, lower lines of code for better performance, etc. Tools are also another wonderful way to find some code library’s that you may have never heard of before. For example, the site replit they have a smart code ide which I consider a tool that helped me out and I discovered jQuery and I accessed a whole new level of programming.
Find the article also on my medium site: https://theoverpoweredpc.medium.com/4-ways-to-be-constantly-improving-your-code-f5b05ddac433


Source link

How do I use variable-arguments (varargs) in C++ (effectively)?

So, C++ extends C, and as that being the case, the implementation of varargs persisted (and hasn’t changed, since it could break already existing code).

In C, you could do #include <stdarg.h>, which included some functions for navigating the arguments.
But now most of C’s original .h files are deprecated (in C++).
So I’m wondering, what’s the effective way of using varargs in C++?


Source link

Debugging Multer and other middle-wares

Hi,
I’ve been sipping coffee, rolling cigarettes, and pulling my hair since the day before yesterday.

I have trouble setting what I thought a useful dynamic middle-ware for later implementations. (Post request with so much constraints , now and surely in future).

The issue is with Multer, if you know, Multer is Node.js middleware for handling (parsing) multipart/form-data. What I expect, could differ though and this is why I’m setting this super intelligent middle-ware.

I found how to chain middle-wares on runtime, which is not a very usual task you find around, but possible and very useful for my case: connect-sequence

The solution dates a bit as you can see. Anyway, here is my slice of my middle-ware (that constructs and runs other middle-wares in return).

`async function magicMiddleware(req, res, next)
const contentType = req.get(‘content-type’)
const form = formidable()

if (contentType.indexOf('multipart/form-data') > -1) 
    await form.parse(req, function (err, fields, files) 
        if (err) 
            console.log(String(err));
            return;
        
        magicMiddleware_(fields)
    )
 else 
    magicMiddleware_(req)


const section = req.params[0]
const method = req.method

const magicMiddleware_ = (body) => 
    const 
        secured,
        upload,
        geolocation,
        illustrations,
        schema
     = constraints[process.env.NODE_ENV][method][section]
    singletonSchema = schema()

    // Third party middlewares
    var seq = new ConnectSequence(req, res, next)
    debugger;
    const validating = celebrate(
        [Segments.BODY]: singletonSchema,
    )
    if (upload)  
        console.log('attaching multer')
        seq.append(ops.multer) 
    
    if (!singletonSchema.called) 
        seq.append(validating)
    
    seq.append(errors())
    if (secured)  
        console.log('attaching multer')
        seq.append(ops.auth0) 
    
    seq.run()
    console.log(req.body)

`

It is to know that third party middle-wares could mismatch. One adds something to req and one remove the same thing for instance.

I run debugger and couldn’t find out but I think multer specifically is not running well, It is running but not well; req.body is , not undefined and not anything else.

I put multer at first in the sequence to be able to parse multipart/form-data data I’m testing right now, then there is celebrate (Joi based validation middle-ware). Then there is auth0 too (for passwordless authentication) which is working also.

Of course there multiple application middle-ware attached when the app starts. But none is susceptible of causing harm as if I push multer, celebrate and auth0 as middle-wares directly (as usual), all works fine. Data is parsed, req.body is there with the uploaded file and input text fields.

I’m pulling my hair, really. As I don’t want to cancel all this and start from zero pushing middle-wares directly on multiple post requests (with different constraints: like one runs without authentication, the other expects text/plain all combinations might bahave differently on different environments, like no upload when testing with Postman).

If you have a hint, I will follow up with test. If you want to jump on code, here is the file and here is the repo.

Note: there is a bug in connect-sequence. It is expecting err (passed through next(err)) to be different that undefined. But Multer appears to push null when there is no error. So there is this, I modified code accordingly.

From this:
if (err !== undefined) {

if(err)

Thanks a lot !!!

to this


Source link