Skip to content

Instantly share code, notes, and snippets.

View dibyasonu's full-sized avatar
🎯
Focusing

Dibya Ranjan Jena dibyasonu

🎯
Focusing
View GitHub Profile
@dibyasonu
dibyasonu / lock.py
Created January 30, 2022 18:22
Create .swp file manually which is compatible with nano and vim.
import os
LOCKSIZE = 1024
lockdata = bytearray(LOCKSIZE)
file_name = 'balance.dat'
mypid = os.getppid()
def strncopy(parent_value, child_value, start):
if start >= len(parent_value):
@dibyasonu
dibyasonu / Readme.md
Last active December 9, 2018 16:50
A small batch script to run MATLAB 2017 after license has expired.

Steps

  • Copy the below code and save it with any name and extension as .bat .
  • When you need to run MATLAB execute the file you have created.
  • After the activation is complete, the application can run with original time. So the script pauses for 60 sec after starting the application and then restores the actual time. This allows you to use internet while using MATLAB. But depending on different system, the time to start MATLAB may vary.
    So you can change the code accordingly, by changing the line 47 if required timeout /t [time in sec].

Optional

  • Keep the file in your matlab project folder and add the folder to the path.