Trending Feed

today successfully Performed crud operations in docker Mongo container using Prisma. which was tough for me because Prisma required replica set database. it took lots of time cuz there was unknown type bug in that mongo image which is forbidden to connect express server. i tried to find that problem over the whole internet even chat gpt did'nt solve my problem i was very frustrated and i tried many steps to solve that problem like running many time multiple containers on same network bridge, port ,db,rs.initiate,extra_hosts,environment configuration etc . but end the end I solved that problem now i am very happy and confident to configure and deploy Mongo replica set to any machine

READ MORE
3 upvotes·2.7K views
Shared insights
on
Visual Studio CodeVisual Studio Code

Help Needed: File Association Error (Code: VSC-006)

I hope you're all doing well. I'm running into a bit of a snag with my ThinkPad L14 Gen 3 laptop [ https://www.lenovo.com/ca/en/laptops/ ] and Visual Studio Code. I'm encountering a "File Association Error" with the error code "VSC-006" and could use some community wisdom to help resolve it.

Problem Description: Whenever I try to open certain files in Visual Studio Code, I'm hit with a "File Association Error (Code: VSC-006)." This error is preventing me from seamlessly working on my projects.

Symptoms: The error message appears when attempting to open specific file types. Other files open without issue. I've checked default file associations on my laptop, and they seem correct.

Your help would make a significant difference in getting back to smooth coding. Thanks in advance for your expertise!

READ MORE
3 upvotes·3.1K views
Front-end developer at Codifica.dev·
Shared insights
on
Cloud FirestoreCloud Firestore

I was tasked with migrating data found in an array containing a series of arrays of objects within the documents of our Firestore database to a subcollection. The purpose of this migration was to improve the management of this information, making it easier to filter, edit, and delete this data. I developed a function to filter the documents that had some data within these arrays and soon found over 500 documents to migrate. To solve this problem, I developed a JavaScript logic that involved separating this data into an object called "data" and also obtaining the document's ID to which this data belonged. Then, I saved this data in the subcollection of the document with that ID.

Snippet of code to retrieve documents in the collection:

const q = query(
  collection(db, "clientes"),
  where("empresa", "!=", "teste")
);
const querySnapshot = await getDocs(q);

Snippet of code where i filter the necessary data from each document:

let clientes = [];
querySnapshot.forEach((doc) => {
  const acessos = doc.data().acessos;

  if (acessos && typeof acessos === "object") {
    Object.entries(acessos).forEach(([categoria, objetos]) => {
      if (Array.isArray(objetos)) {
        objetos.forEach((objeto) => {
          const {
            email = "",
            nome = "",
            observacao = "",
            senha = "",
          } = objeto || {};

          let cliente = {
            id: doc.id,
            razaoSocial: doc.data().razaoSocial,
            categoria,
            email,
            nome,
            observacao,
            senha,
          };
          clientes.push(cliente);
        });
      } else {
        const {
          email = "",
          nome = "",
          observacao = "",
          senha = "",
        } = objetos || {};

        let cliente = {
          id: doc.id,
          razaoSocial: doc.data().razaoSocial,
          categoria,
          email,
          nome,
          observacao,
          senha,
        };
        clientes.push(cliente);
      }
    });
  }
});

return clientes;

Function I used to retrieve and separate the data, and then register it in the subcollection with the registerAccess() function:

async function fetchCustomersWithAccess() {
  const result = await listCustomersWithAccess();
  result.forEach((doc) => {
    const data = {
      categoria: doc.categoria,
      email: doc.email,
      nome: doc.nome,
      observacao: doc.observacao,
      senha: doc.senha,
    };

    const docId = doc.id;

    registerAccess(docId, data);
  });
}
READ MORE
4 upvotes·3.8K views
Shared insights
on
Windows Server Windows Server

Best OS Options for 1U Rack Servers: Linux vs. Windows Server

Hello Everyone

I'm currently in the process of setting up a new 1U rack server, and I'm facing a crucial decision regarding the operating system (OS) to install. I know that the choice of OS can significantly impact performance, security, and overall server functionality. In particular, I'm torn between Linux and Windows Server.

I would greatly appreciate your insights and experiences on this matter. Here are a few questions to consider and discuss:

Which operating system (Linux or Windows Server) have you found to be more reliable for 1U rack servers [ https://www.lenovo.com/ch/fr/c/servers-storage/servers/racks/ ] in your experience?

Are there specific use cases or workloads where one OS outperforms the other on a 1U rack server?

What are the security considerations when choosing between Linux and Windows Server for your rack server?

How user-friendly are these OS options when it comes to server management and administration?

Are there any compatibility issues with hardware or software that you've encountered with either OS on 1U rack servers?

What are the licensing costs associated with both options, and how do they factor into your decision?

Have you had any notable experiences, positive or negative, with support and community resources for either OS?

Are there any other factors that you believe are crucial in making this decision?

Your insights and experiences will be immensely valuable in helping me make an informed choice for my 1U rack server. I'm eager to learn from your expertise and engage in this discussion.

Thank you in advance

READ MORE
3 upvotes·1 comment·5K views
Nate Daugherty
Nate Daugherty
·
November 16th 2023 at 8:28AM

Do not take this the wrong way but based on your question alone it shows you are doing something thats highly likely way over your head and technical knowledge currently. There really is any OS called "Linux" but there are tons of distributions out there with many of them being great down to poor unmaintained junk. When you pick a distro its usually based on your business needs and who has what skillset to manage servers either Windows or a Linux or Unix distro. A 1U rack server means almost nothing without saying the model and specs.. usually your application will determine what the server sizing/specs are to be but thats why I said this question really shows how badly you need to hit the books or training sites which we all had to do to get into this field.. when I came up it was read 7 1200page Microsoft Server cert books to get a MCP and MCITP:SA and then VMware came to life and I have been a VCP since they first had a test... This sounds like its for a business not a sandbox for you to play at home with right? Is this a micro small business that doesnt have any current IT infrastructure? If that is the case you can consider your timing to be lucky because we now have very mature, secure and mostly stable enterprise level clouds out there where if you are starting a business or your business is small and just now starting to "need" server based services like Active Directory

and other basic enterprise functions and with the right person or training you can basically now do anything in AWS or Azure and all you really need to do is make sure you have business class internet with enough bandwidth to support what the business is doing.. most businesses are going to have a mix of servers like Windows Server for their Active Directory Services, DNS, DHCP, Email and so on and many times the developers will need/want Red Hat Enterprise Linux or "RHEL" for short.. While you can get most any distro of linux free Red Hat is the industry leader in the game because they sell their enterprise level products with support agreements and you will need to do the research on those costs as it will help you understand vs a random person giving you information and I honestly couldnt tell you the last time I knew the price of a single cal for Windows because since 2016 I moved to a new business to manage their VMware on converged infrastructure (now hyperconverged or HCI) and we are over 99% virtual with

only a few standalone physicals for AD infrastructure and we have a few apps out of thousands that "need" to be physical mostly because they have hundreds of TBs or even a PB+ of data and they would constantly have issues and instead of fixing code they would blame it on being virtual and they complained enough to get executive override to go physical and I told them when they asked they would still have the same issues because they were already 1:1 on VMware as a "special case" and wouldnt you know they all still had the same issues until a years later when someone finally fixed some issues in their code. With 1 physical server what are you going to do when the motherboard fails

and if you didnt purchase 4 or 8hr support with parts for X years you could be down days, weeks I dont even know.. thats why cloud is the way to go for any new businesses or growing business and you will hear cloud is expensive but thats going to come from a lot of guys with my background we were built and formed by building servers on Dell, HP, Cisco etc and wiring up datacenters because thats what you had to do before cloud was actually useful, secure etc.. Does this businesses even have a firewall that is capable of protecting servers behind your connection? If not its just another reason to go cloud but that server might still be useful to have onsite.. If you go with Windows Active Directory it may make sense to have a local server onsite part of that domain for onsite users to have quicker logins and such but with todays speeds and with AWS having so many datacenters all over the US and world I dont even know if small businesses even go that route now or not.. I have been in this huge org now for 8 years where we have nearly 80k

servers (virtual) 30k containers all virtual on top of VMware and 25k+ virtual desktops with VMware Horizon and this is all in the most regulated field there.. think $$.. So with it being so big we have entire teams dedicated to everything.. like we have a "smallish" cloud footprint I am told with a few million per year in spend and I cant even tell you the name of anyone on that team we just have zero interaction and if this was a normal sized company say 1k-5k employees the IT team would likely been all together and maybe a 8 to 16 person sized team and maybe another 10 for helpdesk which was about the size of most places I had been before moving over to this gig.. you want to be in a smaller

sized place if you eagar to learn but this may be too small if you dont have anyone already skilled to learn from and honestly you will need to read or bust out the credit card and at least do free trials of Pluralsight and one other although i believe pluralsight has bought almost every competitor at this point. Hope that helps a little but just my 2 cents on the OS pick because of lack of time/knowledge etc for now Windows Server is probably your best bet especially if your decent with current Windows 10/11 desktop they

have basically made server look like windows 10/11 which is obviously a user friendly GUI.. Some linux distros come with a gui but most server builds will be command line based but a gui can be installed but legit linux admins would make fun of this lol... this is also another reason most people even doing just home lab setups to learn and get certifications they take a used 1u or even now with the smaller intel nucs and other mini platforms coming out with 32GB/64GB+ of ram and decent processors and vmware will run good on them so you dont have to choose a single OS but its hard to do alot of the training and learning with just one device which is why if you do some research on latest vmware homelabs you can get ideas of what others blog about building them and go from there... William Lam a vmware employee has an infamous blog where he writes alot about homelab stuff but just explore the tech bloggers and youtubers that alone will help you learn alot..

·
Reply
Engineer at L&T Technology Services Ltd.·

So, - you like using Windows, - you like using Docker, - you still want to use a Linux VM in a hypervisor, but found out that using a Type-2 Hypervisor like VirtualBox with Docker Desktop installed on Windows relegates it to run in software mode (the slow mode), and not hardware-accelerated, - AND you don't want to pay for a Windows Pro/Enterprise license, so you stick to Home.

Now, what do you do?

You brew a cup of coffee (or beer if that's what you like) and run this script (linked to Github): https://github.com/palaashatri/mostlyrandom/blob/main/scripts/hyper-v-on-windows-home.bat

OR the PowerShell alternative (linked to Github): https://github.com/palaashatri/mostlyrandom/blob/main/scripts/hyper-v-on-windows-home.ps1

And voila, you can now use Hyper-V manager (a type-1/native hypervisor), on a Windows 10/11 Home device, along with Docker Desktop! Enjoy your hardware-accelerated Linux VMs, Docker, all on Windows Home, as if they're running a Pro/Enterprise license of Windows!

Tested and running on Windows 11 Home.

READ MORE
7 upvotes·10.5K views
Web developer ·
Needs advice
on
JavaScriptJavaScript
and
PythonPython

Hello everyone,

I'm a computer engineering student, and I want to become a fullstack developer but I have a tendency to machine learning and data. Recently I decided to learn Python for the backend because I already know JavaScript with the React library for the frontend to create fullstack web apps. I want to know if I'm going on the right path with combining the backend with the frontend for future AI projects.

Thanks.

READ MORE
14 upvotes·15K views
Replies (3)
Recommends
on
Django

There is no one way but I think you’re starting off fine . If you learn Django as someone who leans towards machine learning you may fall in love . Django has all of the power of python paired with JavaScript, html and css. It’s extremely powerful and fun. I know the MEAN and MERN stack are very popular but Django is a solid competitor against them because you can use any python library out the box in your project . Just some food for thought. good luck !

READ MORE
10 upvotes·13.3K views
Recommends
on
JavaScript

I strongly recommend javascript(Node.js )for the back end, because 1. Most company use it. 2. Its a library not a framework; you have more control over what you are making. 3. you could make your AI projects make its API and use it to integrate it into your website . Lastly even though you are doing full stack you still have to specialize in either back or front, Just for good meaures

READ MORE
7 upvotes·2 comments·14.4K views
microappstech
microappstech
·
October 27th 2023 at 7:07AM

But it's too slow can only control 0.5 M request per sec

Where others can make more than 7M request per sec

https://dotnet.microsoft.com/static/images/redesign/shared/tech-empower-results.svg

·
Reply
Amjad tales
Amjad tales
·
October 19th 2023 at 1:56PM

I’ve seen that nodejs is heavy for data processing which makes it not suitable for AI! Thank you

·
Reply
View all (3)
Senior Software Engineer at KMW Reisen GmbH·
Shared a protip
on
NGINXNGINX
at

When analyzing our access log, we saw some attack patterns. We wrote some block rules to filter the most common ones. These are the ones, that fit our application. Since we use Symfony with speaking URLs, eg. no valid URL should contain a ".php" ending. This rule alone prevents most of the traffic reaching deeper into the stack. Also blocking of dot-files (common configs) is an additional safety net. Since we analyze our access log on a regular base, we can add additional rules if needed.

map $request_uri $isBlocked {
  default 0;
  # still allow .well-known
  ~^/\.well-known 0;

  # wordpress attack
  ~*.*wp-(admin|login|content).* 1;
  ~*.*wordpress.* 1;

  # other common attacks
  ~*.*(phpmyadmin|pma|myadmin)([^a-zA-Z0-9\.\-].*)?$ 1;
  ~*.*(typo3|joomla|drupal|contao).* 1;
  ~*.*(setup|install)\.php.* 1;
  ~*.*(cgi-|cgibin).* 1;
  ~*.*/(webtools|ws|storage|htbin)/.* 1;

  # file endings: x.exe, x.exe.foo, x.exe/foo; but not x.exefoo
  ~*.*\.(exe|cmd|asp|cgi|pl|php|sql|py|cfg|yaml|yml|dat|log|lock)([^a-zA-Z0-9\.\-].*)?$ 1;

  # like "php://filter/convert.iconv..." or other like "ftp://" in path
  ~*.://.* 1;

  # parent directory "../"
  ~*.*\.\./.* 1;
  # dot files like, .env, .git/config
  ~*.*/\..* 1;

  # sql injections
  ~*.*union.*select.* 1;
  ~*.*('|")(.*)(drop|insert|md5|select|union).* 1;

  # script tag injection
  ~*.*(<|%3C).*script.* 1;

  # evil methods
  ~*.*(eval|xor|sysdate|sleep|now|chr|delay)\(.* 1;

  # base64 en-/decoding
  ~*.*base64(_)?(en|de)code.* 1;

  # php super globals
  ~*.*(GLOBALS|ENV|REQUEST|SESSION|SERVER)(=|\[|\%).* 1;
}

map $http_referer $isInvalidReferer {
  default 1;

  # empty is fine
  "" 0;
  "-" 0;

  # should contain valid URL including protocol
  ~^http(s)?://.+ 0;
}

server {
  # ...

  # prevent communication of current nginx version
  server_tokens off;

  if ($isBlocked) {
    return 404;
  }
  if ($isInvalidReferer) {
    return 400;
  }

  # location ...
}

Besides this, attacks are reported to the providers abuse contact. If attacks don't stop we use an additional rule set for blocking IP-ranges.

READ MORE
1 upvote·14.1K views
Senior Software Engineer at KMW Reisen GmbH·

We plan to migrate our continous integration platform from Drone to Woodpecker CI, since the open source version of drone is no longer maintained. Alternatives were Jenkins, Bitbucket Pipelines, Concours CI or a migration to GitLab. Woodpecker CI as fork looked like the easiest way to migrate. The migration is currently evaluated. Results may follow later.

READ MORE
2 upvotes·12.6K views