Skip to content

Instantly share code, notes, and snippets.

💾
Back to coding!

Rahul rahuldottech

💾
Back to coding!
Block or report user

Report or block rahuldottech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rahuldottech
rahuldottech / getcputemp.cmd
Created Jul 30, 2019
Handy scripts to use when SSH-ing into servers for
View getcputemp.cmd
@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 Oct 24, 2018
Pseudocode for modulus and multiplication functions with only addition and subtraction
View pseudo-mod.txt
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 Oct 11, 2018
invShell [Windows/VBS] - Run batch files, commands and executables invisibly
View details.txt
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 Oct 11, 2018
[Arduino] buttonWait - wait for button press before further execution.
View 1_details.txt
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 Sep 22, 2018
What I wrote while watching Tom Scott's video. Turned out pretty well. https://www.youtube.com/watch?v=QPZ0pIK_wsc
View FizzBuzz.cpp
#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 Oct 11, 2018
Download with powershell. Supports HTTPS.
View details.txt
powershell-download by rahuldottech
License:
MIT license - https://github.com/rahuldottech/license
@rahuldottech
rahuldottech / 1-usage.php
Last active Aug 26, 2018
Usage examples for varDx
View 1-usage.php
<?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 Aug 22, 2018
Usage examples for secSesh
View login.php
<?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 Aug 19, 2018
PHP session management
View login.php
<?php
require 'secsesh.php';
session_start();
if(/*credentials check out*/){
s_start();
}
header( 'Location: somePage.php' );
View svg_with_js.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.