Skip to content

Instantly share code, notes, and snippets.

View krsnvijay's full-sized avatar
🐎

Vijay Krishna Vallabhaneni krsnvijay

🐎
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component language="neutral" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
</settings>
<settings pass="oobeSystem">
<component language="neutral" name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component language="neutral" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
</settings>
<settings pass="oobeSystem">
<component language="neutral" name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-US</InputLocale>

Problem - check if two ips are of same subnet

  • ip1: 192.168.10.10/23
  • ip2: 192.168.11.10/23

Summary of steps

  • Find the subnet_ip, then find the num_hosts in that sub network
  • using num_hosts in that subnet find out the start_address, last_address
  • if the second ip is in that range then they are of same subnet otherwise not

Get ip,subnet_mask in binary

apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@krsnvijay
krsnvijay / undo_stack_help.ipynb
Last active April 22, 2021 15:54
Simplify your undo stack data structure
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krsnvijay
krsnvijay / Client.java
Created October 1, 2019 02:05
Simple Java Socket
import java.io.DataOutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.sql.Timestamp;
public class Client {
public static void main(String[] args) {
Socket client;
DataOutputStream dos;
@krsnvijay
krsnvijay / BiPrimes.java
Last active September 21, 2019 00:07
PCT_Concordia
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.stream.Collectors;
public class BiPrimes {
public boolean[] primes;
@krsnvijay
krsnvijay / schema.graphql
Last active July 8, 2019 08:28
RLE Suite Graphql Schema
type User @model {
id: ID!
username: String!
firstName: String!
lastName: String!
profilePic: String!
email: String!
bio: String
about: String
tags: [String!]
@krsnvijay
krsnvijay / rand_selection_norepeat.py
Last active August 22, 2018 05:41
Select a random element from a list without same selection consecutively
import random
def random_choice(list_data):
'''Select a random element from a list without same selection consecutively
Args:
list_data: List of elements to select from
Returns:
Infinite generator of random selections
'''
#shallow copy
@krsnvijay
krsnvijay / game_of_life.py
Last active August 24, 2018 03:38
John Conway's Game Of Life
import copy
import itertools
class GameOfLife:
def __init__(self, grid: list, width: int, height: int):
self.grid = grid
self.width = width
self.height = height