This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to harden ssh on ubuntu/debian server | |
# follow on my blog http://www.coderew.com/hardening_ssh_on_remote_ubuntu_debian_server/ | |
# checkout the repo for more scripts https://github.com/nvnmo/handy-scripts | |
read -p "Enter your server IP:" serverIP # prompt for server IP | |
read -p "Enter your username(requires root privileges):" username # prompt for username | |
printf "\nChanging the default SSH port is one of the easiest\n things you can do to help harden you servers security. \nIt will protect you from robots that are programmed \nto scan for port 22 openings, and commence \ntheir attack." | |
printf "\n" | |
read -p "Do you want to change default SSH port?[Y/n]" -n 1 portChange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT License | |
// Copyright (c) 2022 Navin Mohan | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
/* | |
use the pthread flag with gcc to compile this code | |
~$ gcc -pthread dining_philosophers.c -o dining_philosophers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ------------------------ | |
* | Newton-Raphson Method | | |
* ------------------------ | |
* | |
* Author: Navin Mohan | |
* Website: https://nvnmo.github.io | |
* | |
* MIT License | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** HOW TO USE | |
** -------------- | |
** Go to http://alexlenail.me/NN-SVG/AlexNet.html | |
** Open console (Ctrl + Shift + J on Chrome) | |
** Paste this script and hit enter | |
*/ | |
document.getElementsByClassName('btn btn-primary btn-add input-group-prepend')[0].classList.add('add-layer-btn') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
def diff(img,img1): # returns just the difference of the two images | |
return cv2.absdiff(img,img1) | |
def diff_remove_bg(img0,img,img1): # removes the background but requires three images | |
d1 = diff(img0,img) | |
d2 = diff(img,img1) | |
return cv2.bitwise_and(d1,d2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script adds a new user to the remote server , adds it to sudoers list and enables passwordless login | |
# follow on my blog https://www.coderew.com/computers/ssh-add-user-remotely-script/ | |
read -p "Enter your Server IP:" serverIP #get server IP address | |
read -p "Enter a new username:" newusername #username for the new user | |
read -s -p "Enter the password for $newusername:" password #password | |
printf "\nEnter the root password of the server when prompted\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ORG 0000 | |
CLR C | |
MOV DPTR,#0100 | |
MOVX A,@DPTR | |
MOV R0,A | |
INC DPTR | |
MOVX A,@DPTR | |
ADD A,R0 | |
INC DPTR | |
MOVX @DPTR,A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/ipc.h> | |
#include <sys/shm.h> | |
#include <pthread.h> | |
#include <string.h> | |
#include <stdlib.h> | |
// gcc -pthread concat.c -o concat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
int main(){ | |
int n,i,a,fd1; |
NewerOlder