This commit is contained in:
nm1 2026-11-04 00:33:23 +05:30
commit 74ae93a96e
300 changed files with 94691 additions and 0 deletions

View file

@ -0,0 +1,61 @@
Extras
1.
2. - https://www.kvstore.io : key-value service 100 keys, 1kb/key.
- https://internxt.com/ : e2e file storage from 2gb to 10gb
- https://uploadcare.com : image hosting
- https://developer.box.com/ : box.com api
- https://blackvid.space/#api : api to display movies maybe
- sentry2 : markdown previewer paste with sharable links
- https://api.invidious.io/ : for invidious
- https://martinheinz.dev/blog/113 : curl usage examples
- https://github.com/LuanRT/BgUtils : utils to pass botguard and youtube attestation challenges
- https://rclone.js.org/ : using rclone with nodejs
- https://transfer.adminforge.de/
`curl --upload-file ./hello.txt https://transfer.adminforge.de/hello.txt`
using https://github.com/dutchcoders/transfer.sh
 
using jsdom to parse js data
```js
const fetch=require('node-fetch');
// import { JSDom } from "jsdom"
const {JSDOM} = require("jsdom")
const url = 'https://www.mediafire.com/cdn-cgi/challenge-platform/scripts/jsd/main.js';
const options = {method: 'GET'};
async function main(){
try {
const response = await fetch(url, options);
const data = await response.text();
// console.log(data);
const dom = new JSDOM()
global.window = dom.window
global.document = dom.window.document
eval(data)
console.log(global.window)
} catch (error) {
console.error(error);
}
}
main();
```
 
Others
1. 0x0.st
`curl -F'file=@yourfile.png' https://0x0.st`
2. https://docs.filen.io/docs/api/specs/ : filen, 3 month temp storage

View file

@ -0,0 +1,46 @@
Reverse Engineering
- sdrive(Works only in nodejs due to CORS)
```jsx
const fetch=require('node-fetch')
const fs=require('fs')
const FormData = require('form-data');
const axios=require('axios')
const file=fs.readFileSync('image_icon.png')
const url='https://sdrive.app/publicapi/upload'
// const formData=new FormData()
// formData.append('file',file)
// fetch(url,{
// method: 'post',
// body: file
// })
// .then(res=>res.text())
// .then(html=>{
// fs.writeFileSync('content.html',html)
// })
const formData = new FormData();
formData.append('file', file, { filename: 'image_icon.png' }); // Specify the filename when appending the file
axios.post(url, formData, {
headers: {
...formData.getHeaders() // Include headers from FormData
}
})
.then(response => {
console.log('File uploaded successfully:', response.data);
// Handle the response data as needed
})
.catch(error => {
console.error('Error:', error);
// Handle any errors that occurred during the upload
});
```

View file

@ -0,0 +1,9 @@
Rumble
https://chatgpt.com/share/6853efa4-c3c9-4089-937e-f3ec1b02b4ab
[rumble_api.txt](../../../_resources/rumble_api.txt)
- To get access token
https://stackoverflow.com/questions/78031116/how-to-get-access-token-for-rumble-api
when uploading

View file

@ -0,0 +1,76 @@
blackbaze
https://www.backblaze.com/docs/cloud-storage-api-operations
**Note** : sharable link not available without adding credit card
### for downloading
Blackblaze B2 operates with a different API than AWS S3, but downloading a file using a read access token is straightforward. To access files in a B2 bucket, you'll typically follow these steps for authorization and then proceed with downloading the desired file.
Steps to Download a File from Backblaze B2
Get Authorization Token: You'll need to authenticate against the B2 API to obtain an authorization token. This is generally done via an API call using your account's Application Key ID and Application Key.
Make a Download Request: Use the authorization token to make a request to download the file from the bucket.
Here are detailed steps:
Step 1: Get Authorization Token
Use the following endpoint to get your authorization token:
Request:
```bash
curl -X GET "https://api.backblazeb2.com/b2_authorize_account" \
-H "Authorization: Basic $(echo -n 'APPLICATION_KEY_ID:APPLICATION_KEY' | base64)"
```
Replace `APPLICATION_KEY_ID` and `APPLICATION_KEY` with your actual credentials.
Response:
This will return a JSON object containing your apiUrl, authorizationToken, and other details:
```json
{
"accountId": "some_account_id",
"bucketId": "some_bucket_id",
"bucketName": "your_bucket",
"downloadUrl": "https://f002.backblazeb2.com",
"authorizationToken": "your_authorization_token",
...
}
```
Step 2: Download the File
Once you have the downloadUrl and authorizationToken, you can download files stored in your B2 bucket. You'll need to format the URL correctly based on the file's path in the bucket.
Example cURL Command to Download File:
Assuming your download URL is https://f002.backblazeb2.com and you have the bucket name and file name:
`curl -L -o LOCAL_FILENAME "https://f002.backblazeb2.com/file/Bucket_Name/Path/To/Your/File.txt" \
-H "Authorization: your_authorization_token"`
Example of the Full Process
Here’s a combined example of both steps in shell commands:
```bash
# Step 1: Get Authorization Token
auth_response=$(curl -s -X GET "https://api.backblazeb2.com/b2_authorize_account" \
-H "Authorization: Basic $(echo -n 'APPLICATION_KEY_ID:APPLICATION_KEY' | base64)")
# Extract the necessary fields using jq (install it if you don't have it)
apiUrl=$(echo $auth_response | jq -r '.apiUrl')
downloadUrl=$(echo $auth_response | jq -r '.downloadUrl')
authToken=$(echo $auth_response | jq -r '.authorizationToken')
# Step 2: Download the file
curl -L -o LOCAL_FILENAME "${downloadUrl}/file/YOUR_BUCKET_NAME/PATH/TO/YOUR/FILE.txt" \
-H "Authorization: ${authToken}"
```
Important Notes
Authorization: Make sure to replace APPLICATION_KEY_ID, APPLICATION_KEY, Your_Bucket_Name, and PATH/TO/YOUR/FILE.txt with your actual values.
Token Validity: The authorization token will expire after a limited time, so you may need to call the authorization endpoint to get a new token if it has expired.
Using Environment Variables: For security, consider storing sensitive credentials in environment variables instead of hardcoding them directly into your scripts.
With these steps, you should be able to easily download files from Backblaze B2 using your read access token!

View file

@ -0,0 +1,31 @@
catbox
- https://catbox.moe/tools.php
- cURL to API
If you want to make curl requests to the API, here are examples of both.
`curl -F "reqtype=urlupload" -F "userhash=####" -F "url=https://files.catbox.moe/174bac.jpg" https://catbox.moe/user/api.php`
` curl -F "reqtype=fileupload" -F "userhash=####" -F "fileToUpload=@cutie.png" https://catbox.moe/user/api.php `
 
Converting to axios
```js
import axios from 'axios';
import FormData from 'form-data';
import * as fs from 'fs';
const form = new FormData();
form.append('reqtype', 'fileupload');
form.append('userhash', '####');
form.append('fileToUpload', fs.readFileSync('cutie.png'), 'cutie.png');
const response = await axios.post(
'https://catbox.moe/user/api.php',
form,
{
headers: {
...form.getHeaders()
}
}
);
```

View file

@ -0,0 +1,43 @@
cloudinary
https://cloudinary.com/documentation/upload_images
`https://api.cloudinary.com/v1_1/<cloud name>/<resource_type>/upload`
`cloud name` is the name of your Cloudinary product environment.
`resource_type` is the type of file to upload. Valid values: image, raw, video and auto to automatically detect the file type.
for upload
```bash
curl --request POST \
--url https://api.cloudinary.com/v1_1/cld-docs/auto/upload \
--header 'content-type: multipart/form-data' \
--form file=@path/to/file/sample.zip \
--form api_key=<API_KEY> \
--form upload_preset=ml_default
```
&nbsp;
response body
```json
{
"asset_id": "3515c6000a548515f1134043f9785c2f",
"public_id": "gotjephlnz2jgiu20zni",
"version": 1719307544,
"version_id": "7d2cc533bee9ff39f7da7414b61fce7e",
"signature": "d0b1009e3271a942836c25756ce3e04d205bf754",
"width": 1920,
"height": 1441,
"format": "jpg",
"resource_type": "image",
"created_at": "2024-06-25T09:25:44Z",
"tags": [],
"pages": 1,
"bytes": 896838,
"type": "upload",
"etag": "2a2df1d2d2c3b675521e866599273083",
"placeholder": false,
"url": "http://res.cloudinary.com/cld-docs/image/upload/v1719307544/gotjephlnz2jgiu20zni.jpg",
"secure_url": "https://res.cloudinary.com/cld-docs/image/upload/v1719307544/gotjephlnz2jgiu20zni.jpg",
"asset_folder": "",
"display_name": "gotjephlnz2jgiu20zni",
"original_filename": "sample",
"api_key": "614335564976464"
}
```

View file

@ -0,0 +1,36 @@
fileditch
https://fileditch.com
- To upload
To upload using curl or make a tool you can post using:
`curl -i -F files[]=@yourfile.jpeg https://up1.fileditch.com/upload.php` (JSON Response)
Javascript(Browser)
```js
const fileInput = document.getElementById('fileInput');
fileInput.addEventListener('change', async (event) => {
const file = fileInput.files[0];
const formData = new FormData();
formData.append('files[]', file);
fetch('https://up1.fileditch.com/upload.php', {
method: 'POST',
body: formData,
})
.then((response) => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then((data) => {
console.log('Upload successful:', data);
})
.catch((error) => {
console.error('Error during upload:', error);
});
})
```

View file

@ -0,0 +1,61 @@
genius
```js
const {parse}=require('node-html-parser')
const fetch= require('node-fetch')
async function fetchLyricsFromLink(lyricUrl){
const lyricContainerSelector= 'div[data-lyrics-container="true"]'
// const htmlString= fs.readFileSync('lyrics.html')
const res= await fetch('https://genius.com/Green-day-the-american-dream-is-killing-me-lyrics')
const htmlString= await res.text();
// const htmlString= `<div>
// <div id="lis">
// <ul>
// <li>first</li>
// <li>second</li>
// </ul>
// </div>
// </div>`
const root = parse(htmlString)
// const obj=root.querySelector(lyricContainerSelector)
const arr=root.querySelectorAll(lyricContainerSelector)
// console.log(obj.outerHTML)
let str=""
for(let element of arr){
// statements
str+=element.textContent
str+='\n'
}
return str;
// fs.writeFileSync('parsed_lyrics.html',str)
}
fetch('https://genius.com/api/search/multi?per_page=5&q=Faith --Weeknd')
.then(res=>res.json())
.then(async(data)=>{
const url= data.response.sections[0].hits[0].result.url
console.log('url: ',url)
const lyrics= await fetchLyricsFromLink(url)
console.log('lyrics: ',lyrics)
})
.catch(console.log)
```

View file

@ -0,0 +1,14 @@
mediafire
- https://www.mediafire.com/developers/ : not anymore
&nbsp;
## Steps
1. Get a session token. Note : Session token will be expired after a couple period of time so is cookie so need to generate them again, means somehow automate login.
2. Using it to get folders and files info of root directory
for folder and files content 2 api api is called and eveyrthing is same in request body except content-type
request body is of form-data, files one will give the sharable link too
folderkey field contains key of parent folder, root one is basically 'myfiles'.
3. for uploadfile, it will check the folder where it is uploaded and quickkey of folder will be there too in response, then it will upload as `application/octlet-stream`, and will send filehash too in headers which is of `sha256sum`. After the resulable upload api, key will be get which will be used for next poll upload thing
4. for getting sharable link : : "https://www.mediafire.com/file/7mpw92w27etlaex/Restfox-main.zip/file" . so format is `https://www.mediafire.com/file/<quick_key>/<filename>/file` or just until quick_key is enough too

View file

@ -0,0 +1,39 @@
nextcloud
upload file
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#uploading-files
```bash
curl -u username:password \
--request PUT \
--url https://nextcloud-fi.webo.hosting/remote.php/dav/files/<user_name>/alternative-front-ends-main.zip \
--header 'content-type: application/octet-stream' \
--data-binary @path/to/your/local/file
```
generating sharable link
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html
- auth
`curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true"`
- get shareable items list
`curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/shares' -H "OCS-APIRequest: true"`
- create sharable link
```bash
curl -u username:password --request POST \
--url https://nextcloud-fi.webo.hosting/ocs/v2.php/apps/files_sharing/api/v1/shares \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'ocs-apirequest: true' \
--data path=/Photos/Birdie.jpg \
--data shareType=3
```
for nodejs fetch, -u username:password needs to be converted into basic auth header so convert `username:password` string to base64 and pass it header as `authorization: Basic <base64_version>`
- upload file
```bash
curl -u username:password --request PUT \
--url https://nextcloud-fi.webo.hosting/remote.php/dav/files/<username>/alternative-front-ends-main.zip \
--header 'content-type: application/octet-stream' \
--data-binary @path/to/your/local/file.zip
```

View file

@ -0,0 +1,5 @@
pastebin
- With curl
`curl -X POST -d 'api_dev_key=YOUR API DEVELOPER KEY' -d 'api_paste_code=test' -d 'api_option=paste' "https://pastebin.com/api/api_post.php"`

View file

@ -0,0 +1,58 @@
sdrive(do not work in client side)
```jsx
import axios from "axios";
import FormData from "form-data";
import fs from "fs";
import dotenv from "dotenv";
import mime from "mime-types";
import path from "path";
dotenv.config();
async function uploadFile(fileStream, filename) {
let formData = new FormData();
let apikey = process.env.apikey;
let base_url = process.env.base_url || "https://v3.sdrive.app";
if (!apikey) {
console.log("Please add your credentials to the .env file");
process.exit();
}
let mimetype = mime.lookup(path.extname(filename));
formData.append("fileupload", fileStream, {
filename: filename,
contentType: mimetype,
});
formData.append("apikey", apikey);
formData.append("network", "shdwdrive");
return await axios
.post(base_url + "/upload", formData, {
headers: formData.getHeaders(), // Set headers from formData
})
.catch((error) => {
const errorInfo = {
status: error.response.status,
statusText: error.response.statusText,
data: error.response.data,
};
throw Error(JSON.stringify(errorInfo));
})
.then((response) => {
return response.data;
});
}
// Example usage
(async () => {
const inputPath = process.argv[2];
const filename = inputPath.split("/").pop();
const fileStream = fs.createReadStream(inputPath);
try {
const response = await uploadFile(fileStream, inputPath);
console.log(response);
} catch (error) {
console.error(error);
}
})();
```

View file

@ -0,0 +1,40 @@
sentry2 (stellar)
```js
const fetch=require('node-fetch')
// const baseurl='https://rentry.co'
const baseurl='https://sentrytwo.com'
const fetchurl=`${baseurl}/api/new`
const jsbody={
content : 'this is text',
custom_url : '',
edit_password: 'secret',
}
const requestBody = new URLSearchParams(jsbody);
const csrfToken='R1ukF9nRyNITFeftszagNiM5g2izx0UtfNkPOIwurFqtVP63L00pQh1ahD6dmfj5' // for rentry, epire in 2025
fetch(fetchurl,{
method : 'POST',
headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
'Content-Type': 'application/json',
// "Referer": 'https://rentry.co',
// 'X-CSRF-Token': csrfToken,
},
body : JSON.stringify(jsbody)
})
.then(res=>res.text())
.then(data=>{
console.log('data: ',data)
})
.catch(err=>{
console.log('err: ',err)
})
```

View file

@ -0,0 +1,127 @@
sirv(500 mb storage)
- https://apidocs.sirv.com
&nbsp;
nodejs
```jsx
const http = require("https");
const options = {
"method": "POST",
"hostname": "api.sirv.com",
"port": null,
"path": "/v2/token",
"headers": {
"content-type": "application/json",
"authorization": "Bearer BEARER_TOKEN_HERE"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write("{\"clientId\":\"ZcnZNfzwRhQExoHFoGpxWJ4p2R\",\"clientSecret\":\"TM3d0CfXxusKMpH3x7kHJYD40qJIR3omTIGXP6wPPkXpIUKLEz/dOJ9v6LbXra3y67XsaGK7iQPmnAuD+fzj+Q==\"}");
req.end();
```
&nbsp;
Javascript(Vanilla)
```jsx
const data = "{\"clientId\":\"ZcnZNfzwRhQExoHFoGpxWJ4p2R\",\"clientSecret\":\"TM3d0CfXxusKMpH3x7kHJYD40qJIR3omTIGXP6wPPkXpIUKLEz/dOJ9v6LbXra3y67XsaGK7iQPmnAuD+fzj+Q==\"}";
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.sirv.com/v2/token");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Bearer BEARER_TOKEN_HERE");
xhr.send(data);
```
to upload file with curl
```bash
curl --request POST \
--url 'https://api.sirv.com/v2/files/upload?filename=%2FREST%20API%20Examples%2Fuploaded.txt' \
--header 'authorization: Bearer BEARER_TOKEN_HERE' \
--header 'content-type: application/octet-stream' \
--data-binary @path/to/your/local/file.txt
```
with nodejs
```js
const fetch = require("node-fetch");
const fs = require("fs");
const path = require("path");
const uploadFile = async () => {
try {
// Replace with your own details
const apiURL = "https://api.sirv.com/v2/files/upload?filename=%2FREST%20API%20Examples%2Fuploaded.txt";
const token = "BEARER_TOKEN_HERE";
const filePath = path.join(__dirname, "your-local-file.txt"); // Path to your local file
// Read the file as binary data
const fileStream = fs.createReadStream(filePath);
// Make the POST request with binary data
const response = await fetch(apiURL, {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/octet-stream", // Appropriate content-type for binary file uploads
},
body: fileStream, // Use the file stream as the request body
});
if (response.ok) {
const data = await response.json();
console.log("File uploaded successfully:", data);
} else {
const error = await response.text();
console.error("Error uploading file:", error);
}
} catch (error) {
console.error("Error uploading file:", error.message);
}
};
// Start the file upload
uploadFile();
```
sharable link format
https://platletinvt.sirv.com/Images/Apple%20Watch%20white.jpg
where this jpg file is in Images folder
platletinvt is username
Images is folder name
rest is filename

View file

@ -0,0 +1,48 @@
tastedive
nodejs
```js
const fetch= require('node-fetch')
const getSimilarMovies=async(input)=>{
// const input="batman"
const searchurl=`https://tastedive.com/api/search?query=${input}&take=9&page=1&searchCategory=default&types=urn:entity:artist,urn:entity:movie,urn:entity:tv_show,urn:entity:book,urn:entity:videogame,urn:entity:podcast,urn:entity:person,urn:entity:place,urn:entity:brand`
try{
const searchres=await fetch(searchurl)
const searchdata= await searchres.json()
// console.log('data :', searchdata)
const entityID=searchdata.results?.[0]?.entity_id
if(entityID){
const similarurl= `https://tastedive.com/api/getRecsByCategory?page=1&entityId=${entityID}&category=movies&limit=18`
const similarRes = await fetch(similarurl)
const similarData= await similarRes.json()
console.log('similarData: ',similarData)
return similarData
}
else{
console.log('no entity_id')
}
}
catch(err){
// console.log('err: ', err)
throw new Error(err)
}
}
module.exports={getSimilarMovies}
```

View file

@ -0,0 +1,83 @@
uploadcare
javascript(vanilla)
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="file" name="" id=""><br>
<button>Upload</button>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.6.7/axios.min.js" integrity="sha512-NQfB/bDaB8kaSXF8E77JjhHG5PM6XVRxvHzkZiwl3ddWCEPBa23T76MuWSwAJdMGJnmQqM0VeY9kFszsrBEFrQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
const url='https://upload.uploadcare.com/base/'
const pub_key='b182e75f948ada5a015f'
const fileEle=document.querySelector("input")
const button=document.querySelector("button")
const formdata= new FormData()
button.addEventListener("click",()=>{
const file=fileEle.files[0];
console.log('file: ',file)
formdata.append("UPLOADCARE_PUB_KEY",pub_key)
// formdata.append("my_file.jpg",file)
formdata.append("my_file.jpg",file)
axios.post(url, formdata, {
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
// fetch(url,{
// method: 'POST',
// headers: {
// "Content-Type": "multipart/form-data"
// },
// body: formdata,
// })
// .then(res=>res.json())
// .then(data=>{
// console.log('data: ',data)
// })
// .catch(err=>{
// console.log('err: ',err)
// console.log('err message: ',err.message)
// })
})
</script>
</body>
</html>
```
or with fetch
```js
fetch(url,{
method: 'POST',
body: formdata,
})
.then(res=>res.json())
.then(data=>{
console.log('data: ',data)
})
.catch(err=>{
console.log('err: ',err)
console.log('err message: ',err.message)
})
```

View file

@ -0,0 +1,4 @@
Fragmentation
- Answering to your question. Fragmentation occurs because sometimes when you allocate something in memory it doesn't occupy contigous memory cells, to understand it you could imagine a train with wagons. The information that you are putting in this train is getting in the wagons but not in a row, not in a contigous way. Now, since you have to manage memory using partitions you could find yourself with a single process scattered in different memory cells that are being partition edfor that process not leaving enough space for new processes. When you take the old process out of the memory, it doesn't automatically free the space it occupied (in some systems) and this causes fragmentation and memory leaks.
![9c50df0b4457b020a2326c1d18c956bf.png](../../../_resources/9c50df0b4457b020a2326c1d18c956bf.png)

View file

@ -0,0 +1,103 @@
Set 1
- Internet of Things
The Internet of Things (IoT) describes the network of physical objects—“things”—that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the internet. Like smartwathes, sensors in machines, etc
- Domain names
gmail.com is domain name. org, .com are domain name extension or top level domain
- http vs tcp
TCP is the raw data transfer protocol, and http is the encoding sort of TCP manages the data stream, whereas HTTP describes what the data in the stream contains.
So HTTP runs on top on TCP
also
IP indicates, among other information, which IP address a packet should go to (think of a mailing address), while TCP indicates which port a packet should go to at each IP address (think of the floor of a building or an apartment number).so ip address is IP and its port part is tcp.
- Linux kernel
https://www.youtube.com/watch?v=mycVSMyShk8
![fa1e7a12553815c724185b2d73fdd7f2.png](../../../_resources/fa1e7a12553815c724185b2d73fdd7f2.png)
- IPv4 address
https://www.digitalocean.com/community/tutorials/understanding-ip-addresses-subnets-and-cidr-notation-for-networking
It is 32 bit address contains 4 octlets as each section os if 8 bits/1 byte.
from 0.0.0.0 to 255.255.255.255 . so total nodes are 2^32
eg
`192.168.0.5`
- IPv6 address
It is 128 bit address that contains 8 segments of 4 hex digits
`1203:8fe0:fe80:b897:8990:8a7c:99bf:323d`
Compact version is allowed too means we can remove leading zeroes (0s from left)
`8703:0087:0874:0000:76b1....`
it can be written as
`8703:87:874::76b1....`
Compacting rule is that it can be decompressed back too. So this leading we r removing whole segment bcz of `0000` to `::` then this can be done only one time bcz
`1203:8fe0:0000:b897:8990:0000:0000:323d`
If delete whole segment 2 times then
`1203:8fe0::b897:8990::323d`
now in when decompressing it we dont know which side have how many segments. it can be either
`1203:8fe0:0000:b897:8990:0000:0000:323d` (correct one)
`1203:8fe0:0000:0000:b897:8990:0000:323d` (wrong one)
- 2 types of ipv6 address in router
https://www.quora.com/Why-do-I-have-2-different-IPv6-addresses-in-my-device
starting with `fe80` whch ends with scope link is for local connection only and never go outside the subnet and other one dont start with `fe80` and send with scope global can be used for all the actual client communications you would expect to see out across the internet etc.
- IPv4 Classes
- Class A : 0.0.0.0 to 127.255.255.255
for large networks like ISPs
- Class B : 128.0. 0.0 to 191.255. 255.255
for medium networks like enterprise networks
- Class C : 192.0.1.1 - 223.255.254.254
for small networks ie LAN
- Class D : 224.0.0.0 - 239.255.255.255
for multicast addressing
- Class E : 240.0.0.0 - 255.255.255.254
for experimental purposes
- Reserved IP address
localhost ie loopback range is useful reserved address specified from `127.0.0.0` to `127.255.255.255`
Each class have their own reserved private address
- Class A : 10.0.0.0 to 10.255.255.255
- Class B : 172.16.0.0 to 172.31.255.255
- Class C : 192.168.0.0 to 192.168.255.255
Their advantage is that if there is no internet then computer can use these private IPv4 address
- Netmasks and Subnets
Netmask is also called subnet mask
The process of dividing a network into smaller network sections is called subnetting
Each address space is divided into network and host potion. In class C ip `192.168.0.15` first 3 octlets like `192.168.0` is network and `15` is the host
Subnetting is the process of dividing a single network into smaller subnetworks, each with its own network address and range of usable internet protocol (IP) addresses.
Subnet mask is specification/config which contain how many bits are allocated to network portion. In case of home wifi router subnet is 24 means 3 octelts `192.168.0` and last one ie `15` is host one
Subnet /24 means 3 oclets of network portion so it can be represented as `255.255.255.0` 0 represents host section and (255) with base 10/11111111 with base 2 represents network section
- Calculating network portion and host portion with subnet
Using Bitwise AND.
In `255.255.255.0` the first 24 bits are 1 and others r 0 so when operated with `192.168.0.15` then first 3 octlets will be come as of network portion and rest host portion bcz
1.1=1
1.0=0
1.X=X
0.X=0
0 and 255 host are reserved so they cant be used so that leave us with 254 hosts.
Note : Wifi router can connect upto 250 devices so a single IP will connect to 250 devices. Other than 0 and 255 4 more r reserved bcz of mesh network maybe
for wifi router
subnet mask for ipv6 address in wifi router is /64 means first half of network section, rest for host section
- Subnetting
If we have subnet mask `255.255.255.0` and if we wanna divide our host portion into 2 parts then use the first bit for that thus dividing them into 128 and 128.
From
`1111 1111 1111 0000-0000`
To
`1111-1111 1111-1111 1111-1111 1000-0000`
So The ipv4 address is `192.168.0.128` used a divider. Now we have 2 subnetworks.
First subnetworks from `192.168.0.1` to `192.168.0.127`
Second subnetworks from `192.168.0.129` to `192.168.0.255`
This happened after using 1 bit of host portion. If used more bits then more subnetting is possible.
- CIDR Notation
A system called 'Classless Inter-Domain Routing' or CIDR is alternative to traditional subnetting
Instead of using traditional subnetting which has a fixed netmask like in router it is `255.255.255.0` we can have our own specification of allocation of network and host section of ip address. We can use this `192.168.0.15/24` (CIDR notation) which means ip address is `192.168.0.15` and 24 bits for network and rest 8 for host.
We can change this to `192.168.0.15/23`. Now we can have ineresting IP addresses like range from `192.168.0.0` to `192.168.0.255` and `192.168.1.0` to `192.168.1.255` so total of 512 hosts
- Nginx, traefik, istio, linkerd, consul etc are called ingresses and service meshes
&nbsp;
- how vpn transports http traffic
1. Your browser sends HTTP traffic (which uses TCP).
2. The VPN software wraps (encapsulates) that TCP packet.
3. The encapsulated packet is sent to the VPN server using UDP.
4. The VPN server unwraps it and forwards the original HTTP request to the website.
5. The response comes back the same way.
&nbsp;
http codes
- https://www.dotcom-monitor.com/blog/the-10-most-common-http-status-codes/
[90 Common HTTP Status Codes_ Full Reference _ Triage (2_9_2026 5_39_44 pm).u.zip.html](../../../_resources/90%20Common%20HTTP%20Status%20Codes_%20Full%20Reference%20_%20Tria.html)

View file

@ -0,0 +1,60 @@
Theory
1_WHAT IS STORAGE VIRTUALIZATION?
Storage virtualization is the pooling of physical storage from multiple storage devices into what appears to be a single storage device -- or pool of available storage capacity. A central console manages the storage.
2_WHAT REALLY IS STORAGE VIRTUALIZATION?
storage virtualization is when you take multiple physical storage devices and combine them to make one, or multiple "virtual" storage devices with the storage capacity to meet your needs
3_WHAT DOES STORAGE VIRTUALIZATION DO?
so lets say you work IT at a hospital, and you got 500 different computers each with 1TB of hard drive space each, and they are all connected, controlled, and managed by an internal hospital IT network, and your the IT network guy.
now, all those hard drives are being used, each employee with a computer has their operating system installed, and their own personal work files, which means that each hard drive is going to have a different amount of space left on the hard drive, some might have 900GB of data left, some 500GB, some 200GB, but each and everyone one has a different amount of storage space.
now lets say, you as the network IT guy, wanted to create a storage space, out of 1GB, of all the hard drives you have access to, so you wanted to go into each employees computer, and borrow 1GB from each computer, and create a storage space out of all those 1GB's, you borrowed, totalling a drive of 500GB,
with storage virtualization you can do exactly that, you can take separate physical storage devices, you can take all of the storage space they have or only a part, and create a virtual storage device
&nbsp;
&nbsp;
Transpiling
It is often called 'transpiling', when you translate code with JS-preprocessors like CoffeeScript, TypeScript (you name it) to plain JavaScript.
Whereas compiling and interpreter converts code into machine language
CI/CD
- pull code from git repo, build it and deploy it, these are done by scripts
&nbsp;
**Kernal,GNU**
- Think of GNU as a set of tools, kind of like Microsoft Office is a set of programs.
The design of the Linux filesystem (treating everything as a file or directory) is a choice made for the Kernel, and programs that want to have any chance of running need to adhere to the Kernel
- filesystem : So we have a storage device, this could be a HDD or SDD that a computer can write data to.
Ontop of that we have firmware that sits on said physical device, this is rarely updated as it's very simple and straightforward
Above this we have the driver for the computer. This provides a standardized manner in which the operating system can read and write to the storage device.
&nbsp;
The OS uses partitions to segment out where data can go. The format of data ontop of a partition varies, being something like NTFS, FAT32, ext4, btrfs, APFS, ZFS etc.
&nbsp;
The "filesystem" can refer to one of two things:
1. The actual formatting of how the OS reads the partition for data. ext4 and btrfs work by using something called `inodes` that define basic metadata about a file and the start and end of it's payload... So if you lose the inode you basically lose the file
2. General interfacing with a formatted partition
e.g. interfacing with the filesystem
3. metadata is a common term for data providing information about one or more other pieces of data, when inode is a type of metadata that stores basic information about a regular file, directory, or other file system object.
4. The kernel is kind of like the nervous system of a human, it does a lot of control and operation of the low-level functionality.
The two common Kernel interfaces are as a filesystem (How linux and unix work) of via APIs (Windows 🤢)
Any command you enter on a PTY first asks the kernel to start a new task (process) with some given parameters. It locates the executable and creates a new process passing the parameters that were provided. It bill bind an input and output stream (stdin/stderr/stdout) etc and let the program access sockets and whatever else based on permissions defined for the executor of the program and the program itself
5. "space" refers to the execution of a program.
If something runs in "kernel" space that means it's running under the operating system. If it runs in "user" space that means it runs for a particular user"
&nbsp;
Think of it like this: Nano runs for user `robin` and xorg runs for user `root`
The init system controls the root process, and which `user` owns it. I'm not really an expert on this so take my explanation with a grain of salt
per a stackoverflow thread, a program run by the root user runs in user mode and switches to kernel mode when needed and then back to user mode (it goes back and forth)
source : https://stackoverflow.com/questions/2354125/difference-between-processes-running-in-
![679ae4ae6918fb696965d56e43213749.png](../../../_resources/679ae4ae6918fb696965d56e43213749.png)

View file

@ -0,0 +1,73 @@
Tor (The Onion Router)
https://www.linkedin.com/pulse/what-does-happen-inside-tor-network-how-work-arun-kl
tor_anonymity_expert_guide.mp4 https://files.catbox.moe/dqk06e.mp4
https://www.reddit.com/r/explainlikeimfive/comments/c5sw4b/eli5_what_is_a_tor_browser_how_does_it_work_and/
- Let's use a mail analogy. Let's say you want to send an anonymous love letter to someone named Alice. You don't want Alice to know it was you who sent it, and you'd prefer not to let anyone else know you have a crush on Alice either.
Using a standard browser is like handing your letter directly to Alice. Obviously not going to work.
Fortunately, there are thousands of strangers who volunteer to run a love letter anonymization network. Out of the thousands of strangers, you randomly select three of them. Let's call them stranger #1, #2, #3.
So here's what you do: Take your letter addressed to Alice. Place it in an envelope, addressed to stranger #3. And put that envelope into another one addressed to stranger #2, and finally another one addressed to stranger #1.
Now deliver the envelope to stranger #1. Stranger #1 opens it and finds the envelope addressed to stranger #2, which he delivers accordingly. Stranger #2 opens the next envelope, finding and delivering the envelope addressed to stranger #3. Stranger #3 opens it, finding the letter addressed to Alice, and delivers it to Alice. Since it is illegal to open an envelope not addressed to you, each stranger can only open up one layer. (In Tor, this is cryptographically enforced with math, not postal law.)
So what's the final result? Stranger #1 knows who sent the letter, but not its contents nor its ultimate destination. Stranger #2 knows neither who sent it, nor the contents, nor the destination. Stranger #3 knows the contents, but not who sent it. Alice also knows the contents but not who sent it. Thus anonymity is achieved: nobody other than you knows both the contents and the sender.
So that's Tor in a nutshell. There's also a lot of confusion out there about the differences between Tor and VPN. In this analogy, a VPN is like handing your letter to a trusted friend who hands it to Alice. Your friend is in a position of being able to know both contents and sender, so you're putting a lot of faith in your friend (VPN) to not rat you out. But it has the advantage of not letting a stranger (stranger #3) read your letter, and it's simpler with less hops making a VPN more suitable for daily browsing.
- Volunteers who host the tor nodes are normally belong to privacy respecting organisation , countries or universities to avoid legal trouble. There r some nodes which r controlled by FBI, NSA and law enforcement to catch criminals too
- Understanding techinically
to access hidden service of tor when someone visit the onion site it checks with tor database for introduction point then tor magic applies ie relaying through 3 different nodes which r randomly selected and finally it reaches the introduction point. From Introduction point to hidden site again tor magic/circuit happens ie relaying through 3 different nodes then data comes to hidden service right
- i2p : like tor there is another one ie i2p. tor has clear net access means any surface web contents like google.com can be accessed and also tor network like onion . in case of i2p only i2p network can be accessed. Also i2p is faster
one interesting part is, packages in the i2p network change sizes, which makes it more harder to track and fingerprint
tor has registry server for nodes and if that goes down then it would be disaster. Though chances r less bc it is mainatined by tor project. i2p is p2p and is more decentralized than tor
&nbsp;
&nbsp;
## hosting sites in tor
https://infosecwriteups.com/hosting-tor-website-on-dark-web-the-safe-way-9890d1947b6a
- Installing tor
`yay -S tor tor-browser`
- In `etc/tor/torrc`
Uncomment following
![dd37075b960f36e6595d582e9c0e6acb.png](../../../_resources/dd37075b960f36e6595d582e9c0e6acb.png)
HiddenServicePort 80 127.0.0.1:PORT. It can be any port number wherever site is hosted in localhost. But 80 must be the one other localhost request will be redirected else site wont run
Another error can be faced
![222ea4fd9e8c09d346f85017d5cd8c55.png](../../../_resources/222ea4fd9e8c09d346f85017d5cd8c55.png)
Sometimes this 9050 PORT may not be available so u can change that too
- Then finally `sudo tor` anywhere. Make sure run it as root. or use `systemctl start tor`
- To get another domain just change the hidden service name
In `/etc/tor/torrc`
It can be
`HiddenServiceDir /var/lib/tor/mysite/` too. Now u will get another onion site tooo start as a `tor` user instead of `root` user
- Separate config file
U can have a separate orrc file too anywhere in user directory too like `~/.torrc` too
Use `tor -f ~/.torrc` to start tor wtith different config
- Multiple services running simuntaneouly
In torrc file
```bash
HiddenServiceDir /var/lib/tor/mysite/
HiddenServicePort 80 127.0.0.1:20108
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 127.0.0.1:20100
```
- Starting tor as non root aka as a tor username
Starting tor as root can have some security issues
`systemctl start tor` is a good way of doing that to start as a tor user instead or root
But if we want more customizationa and not stick to default then we can have different torrc file but make sure it is in `etc/tor` directory like `/etc/tor/torrc2`
By default config file is set as `/etc/tor/torrc` so to change it we need to edit `/usr/lib/systemd/system/tor.service` file. Its syslink is created when we enable this service at `/etc/systemd/system/multi-user.target.wants/tor.service`,
Change it like this
```text
ExecStartPre=/usr/bin/tor -f /etc/tor/torrc2 --verify-config
ExecStart=/usr/bin/tor -f /etc/tor/torrc2
```
Then to apply changes reload systemctl by
`systemctl daemon-reload`
and finally restart tor service
`systemctl restart tor`

Some files were not shown because too many files have changed in this diff Show more