Skip to content

Instantly share code, notes, and snippets.

db.user.updateOne(
{ _id: ObjectId("67611ccbf07d7da6773cdd02") },
{
$addToSet: {
locationCountryIds: {
$each: [
ObjectId("6760f74af3b8abfe4f92dd48"),
ObjectId("6760f74bf3b8abfe4f92dd49"),
ObjectId("6760f74bf3b8abfe4f92dd4a"),
ObjectId("6760f74bf3b8abfe4f92dd4b"),
#!/bin/bash
# Add user to sudoers
echo "Adding user to sudoers..."
su -c "usermod -aG sudo $USER" root
su -c "echo '$USER ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/$USER" root
# Update system
echo "Updating system..."
sudo apt-get update && sudo apt-get upgrade -y
{
"status": "OK",
"data": [
{
"YID": 8,
"YEAR": "2022",
"SEMESTERS": [
{
"SEMID": 10,
"CLASSES": [
<!DOCTYPE html>
<html>
<head>
<title>Sign Up Form</title>
<style>
body {
font-family: sans-serif;
text-align: center;
}
import hashlib
import itertools
import time
import sys
import os
# Function to generate substituted variants of a word
def generate_variants(word):
substitutions = {
'o': '0',
import hashlib
import itertools
def generate_variants(word):
substitutions = {
'o': '0',
'l': '1',
'i': '1'
}

Model Example

// Task.cs (Model)
public class Task
{
    public int Id { get; set; }
    public string Title { get; set; }
    public string Description { get; set; }
}

To run the command:

  1. Change directory to the folder that contains the input file grid-6-7.txt: cd /path/to/folder
  2. Optionally, replace grid-6-7.txt with another input file. Make sure that the file is located in the current directory.
  3. Run the command: time docker run -v $PWD:/input -v $PWD:/output clickads/powergrid:latest ./prog /input/grid-6-7 /output/out.txt

This command runs a Docker container that uses the clickads/powergrid image and sorts the specified input file from the /input directory to the /output/out.txt file. The time command is used to measure the execution time of the command.

To run the command:

  1. Change directory to the folder that contains the input file sort-rand-199999999.txt: cd /path/to/folder
  2. Optionally, replace sort-rand-199999999.txt with another input file. Make sure that the file is located in the current directory.
  3. Run the command: time docker run -v $PWD:/input -v $PWD:/output clickads/terasort:latest ./prog /input/sort-rand-199999999.txt /output/out.txt

This command runs a Docker container that uses the clickads/terasort image and sorts the specified input file from the /input directory to the /output/out.txt file. The time command is used to measure the execution time of the command.