Skip to content

Instantly share code, notes, and snippets.

View Himan10's full-sized avatar
🎧
The Armored Entity

Himanshu Bhatnagar Himan10

🎧
The Armored Entity
View GitHub Profile
@Himan10
Himan10 / jobs_model.py
Created March 17, 2024 13:35
User model
class User(models.Model):
"""
Represents a user profile with related details.
This class defines the attributes associated with a user profile.
This class has two foreign keys that point to Job and Company table
"""
def media_upload_path(instance, filename):
return f"user_{instance.user_id}/data/{filename}"

Missing functionalities in API (Jobs)

  1. Jobs
    1. Industry
    2. Job Type
    3. Salary
    4. Qualification
    5. Vacency position
    6. Total applyed (we already have a number of applicants for this)
    7. About the Job:
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] ==== STARTING PLAYER ====
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Player version: "3.3.3" 20230301-8f94f87b97
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] args: ("/opt/genymotion/player", "--vm-name", "07706b39-b5d5-437a-aa36-a71663de9778")
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] "Local socket created at path: /tmp/dcd0d36bfe6c40ac5b8d66e9efb9b069"
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] No proxy set
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Host date and time: "02 May 2023 21:30:52 +0530"
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] "Notifying launchpad of status change: 07706b39-b5d5-437a-aa36-a71663de9778 BOOTING"
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Progress dialog is visible. devicePixelRatio: 1
2023-05-02T21:30:52+05:30 [Genymotion Player:159871] [debug] Device is up to date
2023-05-02T21:30:52+05:30 [Genymo
@Himan10
Himan10 / wiresharkissue.txt
Last active January 4, 2023 15:23
Journalctl stacktrace of wireshark
Jan 04 20:03:42 blackHat systemd-coredump[16912]: [🡕] Process 16904 (wireshark) of user 1000 dumped core.
Stack trace of thread 16904:
#0 0x00007ff4c08ba64c n/a (libc.so.6 + 0x8864c)
#1 0x00007ff4c086a958 raise (libc.so.6 + 0x38958)
#2 0x00007ff4c085453d abort (libc.so.6 + 0x2253d)
#3 0x00007ff4c1aea03c n/a (libwsutil.so.14 + 0xc03c)
#4 0x00007ff4c1afb02a ws_log (libwsutil.so.14 + 0x1d02a)
#5 0x0000564a86f04a63 n/a (wireshark + 0x249a63)
#6 0x00007ff4c0e38ab8 n/a (libQt5Core.so.5 + 0xe0ab8)
@Himan10
Himan10 / discordProblem.py
Created April 23, 2021 09:47
get the data stored in all the curly braces pairs
def get_data_from_file(file_path):
# Read File
with open(file_path, 'r') as file:
data = file.read()
return data
def check_paranthesis(data: str):
""" Check if the string contains valid opening/closing tag """
stack = []
@Himan10
Himan10 / vocabfetch.py
Created March 26, 2021 18:30
Fetch the meaning (short and long) of a given word
#!/usr/bin/python3.8
import types
import requests
from sys import argv
from re import match
from bs4 import BeautifulSoup
from pynput import keyboard
from functools import partial
from colorama import Fore, Style
@Himan10
Himan10 / split.py
Created January 11, 2021 05:28
Implementation of str.split() in python
# Implementation of split method
def split(string: str, separator: str, max_split=-1):
if separator.__len__() == 0 or string.__len__() == 0:
raise ValueError
result = []
temp = ''
i = 0
s_index = 0
full_match = False
@Himan10
Himan10 / code_output.txt
Last active November 26, 2020 18:07
Find songs path that are stored in local directory
Finding tests in NoName
Trying:
main('My December')
Expecting:
/home/hi-man/Music/LinkinPark/Linkin Park - My December. Live Projekt Revolution 2002 Las Vegas._480p.mp4
/home/hi-man/Music/LinkinPark/my_december.mp4
ok
Trying:
main('turn-the page-metallica')
Expecting:
@Himan10
Himan10 / checkRAMSWAP.sh
Created October 18, 2020 15:21
check stats of RAM and SWAP, and notify once any one of them exceeds the limit.
#! /bin/bash
# notify the user
notify-send -u low -t 8000 "checkRAWSWAP" "Monitoring Starts"
### getthe memory and swap int.
var=0
while true; do
mem=$(free -m | grep -P 'Mem.*' --line-buffered | sed -r 's/(\s)+/_/g' | cut -d '_' -f 3)
# g flag in sed command means "globally", change should affect other matched parts too.
@Himan10
Himan10 / zig_zag_conversion.py
Created August 20, 2020 07:51
Convert a normal string into a zig_zag format
## Convert a normal string into a zig-zag form
import numpy as np
class Solution:
def convert(self, string:str, numRows:int) -> tuple:
if numRows < 1:
return string
numCol = round(len(string)/numRows)+1
if numCol < 1: