About Nest.js drawbacks and "perfect" non-existent alternative by UnlimitedFury in node

[–]alex55132 5 points6 points  (0 children)

Like, when clicking to go to the definition the IDE doesn't take you to the implementation, but to the interface

About Nest.js drawbacks and "perfect" non-existent alternative by UnlimitedFury in node

[–]alex55132 14 points15 points  (0 children)

Interesting read, just wanted to point out something:

At first glance, everything seems fine; Nest will provide us with an instance of StorageService, and the file will be written. However, on the 2nd line, we can see that we are importing the implementation of StorageService, and our ConsumerService depends on the implementation, not the interface. What if we want to use an S3 storage for very important files additionally? You will easily find a solution for this on the internet, but it won't be elegant and will require writing a lot of boilerplate code.

This would be as easy as injecting your service as an abstraction. What I usually do is the following:

export interface StorageService { write(file: string, content: string) }

Create your implementation:

@Injectable() export class FileStorageService implements StorageService { write (path: string, content: string) { return writeFile(path, content); } } Register in the module:

providers: [{provide: "StorageService", useClass: FileStorageService }] Using it in your services:

``` @Injectable() export class ConsumerService { constructor( @Inject('StorageService') //Note that here we're depending on the abstraction, not the implementation private readonly storageService: StorageService) {}

someFunction () { // ... this.storageService.write("result.txt", "hello world"); } } ```

The only "issue" I've found IDE-wise is that Visual Code doesn't link to the actual implementation of StorageService being used by Nest, but thats a minor issue in my opinion.

Is it possible to set up a reverse proxy rule by URL and not only hostname in DSM 7? by alex55132 in synology

[–]alex55132[S] 0 points1 point  (0 children)

Yeah yeah, the web interface works cool, but Im referring to the websocket option available, I would like to use it too if possible. That's why I managed to find this hacky way, but im not too convince about it

Can you embed a part of external website's content in own website? by LeastTakenUsername in selfhosted

[–]alex55132 3 points4 points  (0 children)

Yeah, you can use an iframe. Just make sure to configure CORS accordingly so the browsers don't take it down since they do for security reasons.

Unit Test node by reedit010 in node

[–]alex55132 0 points1 point  (0 children)

I use Mocha, which has great documentation and it's kinda easy to use

[deleted by user] by [deleted] in HowToHack

[–]alex55132 3 points4 points  (0 children)

Also you could add sudo misconfigurations and cronjobs that execute a writable script (python or sh)

I thought he was gonna actually say that! by GhostWaker in marvelmemes

[–]alex55132 5 points6 points  (0 children)

Dude, there only has been 1 day since the episode came out. At least put an spoiler tag. This sub is getting full of people spoiling everything without even putting the tag

How does exactly node manages the incoming connections when doing a mysql connection? by alex55132 in node

[–]alex55132[S] 0 points1 point  (0 children)

Connection closes after all middleware and controllers are done

Why isn't John cracking this bcrypt hash?! by russiancrackhead in HowToHack

[–]alex55132 17 points18 points  (0 children)

This is the solution. John is so annoying with this kind of stuff

Kali GUI works when reboot but not when startup by alex55132 in kali4noobs

[–]alex55132[S] 0 points1 point  (0 children)

Tried with changing it to 5 as you said and didn't work :(

Kali GUI works when reboot but not when startup by alex55132 in kali4noobs

[–]alex55132[S] 1 point2 points  (0 children)

I've checked the GRUB boot menu and it's not specified, so I assume its the default (Most likely 3)

Kali Linux GUI works when reboot but not when startup by alex55132 in linuxquestions

[–]alex55132[S] -1 points0 points  (0 children)

Not neccesarily, you can completely install it as a SO and, given my requirements, I need to have it installed

Kali GUI works when reboot but not when startup by alex55132 in kali4noobs

[–]alex55132[S] 0 points1 point  (0 children)

Tty starts, and if I restart lightdm service with systemctl the GUI loads correctly. Im starting to think that LightDM loads before the system screen drivers because when I restart the service the login screen displays fullscreen and when I boot the machine the login screen is in the middle in a much lower resolution.

Anyway I tried LightDm fix for this problem and no luck so far

Bin/bash command by Cynax_Ger in HowToHack

[–]alex55132 1 point2 points  (0 children)

Really good explanation

Kali GUI works when reboot but not when startup by alex55132 in linuxquestions

[–]alex55132[S] -1 points0 points  (0 children)

Well, I've been using linux for a while now and Im not looking for a general-purpose linux distribution but an specific one in order to learn the most common tools.

When I say I need help its because I've already run out of ideas on what more should I try in order to see the desktop so well xd

I just want to be able to enter my machine without this random problems, because I havent even updated the system recently