Skip to content

Instantly share code, notes, and snippets.

@rahuldottech
rahuldottech / getcputemp.cmd
Created July 30, 2019 21:13
Handy scripts to use when SSH-ing into servers for
@echo off
for /f "skip=1 tokens=2 delims==" %%A in ('wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature /value') do set /a "HunDegCel=(%%~A*10)-27315"
echo %HunDegCel:~0,-2%.%HunDegCel:~-2% Degree Celsius
@rahuldottech
rahuldottech / pseudo-mod.txt
Last active October 24, 2018 23:46
Pseudocode for modulus and multiplication functions with only addition and subtraction
1. multiplication:
function input --> (x*y)
if ( either x or y is less than zero ){
FOR loop: product = subtract x from zero y times
} else if ( both are greater than or both are less than zero ){
FOR loop: product = add x to to zero y times
}
@rahuldottech
rahuldottech / details.txt
Last active January 7, 2020 18:32
invShell [Windows/VBS] - Run batch files, commands and executables invisibly
invShell v0.1 by rahuldottech
-----------------------------
License:
MIT license - https://github.com/rahuldottech/license
Usage:
invShell.vbs <command/script> <arguments>
Example:
@rahuldottech
rahuldottech / 1_details.txt
Last active August 18, 2022 09:12
[Arduino] buttonWait - wait for button press before further execution.
buttonWait v0.1 by rahuldottech
---------------------------------
(pause a script till a button is, y'know, *pressed*...)
This code is in the public domain.
Proper schematic at https://arduino.stackexchange.com/a/56805/50258
--
@rahuldottech
rahuldottech / FizzBuzz.cpp
Created September 22, 2018 09:27
What I wrote while watching Tom Scott's video. Turned out pretty well. https://www.youtube.com/watch?v=QPZ0pIK_wsc
#include<iostream>
int main(){
using namespace std;
for(int i=1; i<101; i++){
if(i%3==0){
cout<<"Fizz";
}
if(i%5==0){
cout<<"Buzz";
}
@rahuldottech
rahuldottech / details.txt
Last active January 7, 2020 18:32
Download with powershell. Supports HTTPS.
powershell-download by rahuldottech
License:
MIT license - https://github.com/rahuldottech/license
@rahuldottech
rahuldottech / 1-usage.php
Last active August 26, 2018 11:46
Usage examples for varDx
<?php
require 'varDx.php';
$dx = new \varDx\cDX; //create object
$dx->def('file1.txt'); //define data file
$a = "this is a string";
$dx->write('val1', $a); //write key to file
$dx->modify('val1', "this is another string"); //modify value of key
echo $dx->read('val1'); //read value of key
if($dx->check('val1')){ //check if key exists
del('val1'); //delete key
@rahuldottech
rahuldottech / login.php
Last active August 22, 2018 13:47
Usage examples for secSesh
<?php
require 'secsesh.php';
session_start();
if(/*credentials check out*/){
\secSesh\start();
}
if(\secSesh\check()){
// do stuff after successful login
header( 'Location: somePage.php' );
}
@rahuldottech
rahuldottech / login.php
Last active August 19, 2018 16:59
PHP session management
<?php
require 'secsesh.php';
session_start();
if(/*credentials check out*/){
s_start();
}
header( 'Location: somePage.php' );
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.