Thursday, February 14, 2019

Uninstall software's from Command line Windows 7 / Windows 8 / Windows 10

OPEN a command prompt with Administrator Rights (CTRL + SHIFT + Click CMD in start menu)

Step 1 : List all the installed software 

# wmic product get name  > progs.txt


Step 2: Edit the progs.txt to include following before and after the package name

  Before:
       Windows Live Messenger


   After:
       wmic product where name="Windows Live Messenger" call uninstall

Step 3: rename the file progs.txt to progs.bat


Monday, June 18, 2018

BASH TIMESTAMP FORMATS MOST COMMONLY USED

MOST COMMONLY USED BASH TIMESTAMP FORMATS
#! /bin/bash

# An overly obvious reference for most commonly requested bash timestamps
# Now all you Mac fags can stop pestering me.

cat << EOD
        Format/result           |       Command              |          Output
--------------------------------+----------------------------+------------------------------
YYYY-MM-DD_hh:mm:ss             | date +%F_%T                | $(date +%F_%T)
YYYYMMDD_hhmmss                 | date +%Y%m%d_%H%M%S        | $(date +%Y%m%d_%H%M%S)
YYYYMMDD_hhmmss (UTC version)   | date --utc +%Y%m%d_%H%M%SZ | $(date --utc +%Y%m%d_%H%M%SZ)
YYYYMMDD_hhmmss (with local TZ) | date +%Y%m%d_%H%M%S%Z      | $(date +%Y%m%d_%H%M%S%Z)
YYYYMMSShhmmss                  | date +%Y%m%d%H%M%S         | $(date +%Y%m%d%H%M%S)
YYYYMMSShhmmssnnnnnnnnn         | date +%Y%m%d%H%M%S%N       | $(date +%Y%m%d%H%M%S%N)
YYMMDD_hhmmss                   | date +%y%m%d_%H%M%S        | $(date +%y%m%d_%H%M%S)
Seconds since UNIX epoch:       | date +%s                   | $(date +%s)
Nanoseconds only:               | date +%N                   | $(date +%N)
Nanoseconds since UNIX epoch:   | date +%s%N                 | $(date +%s%N)
ISO8601 UTC timestamp           | date --utc +%FT%TZ         | $(date --utc +%FT%TZ)
ISO8601 UTC timestamp + ms      | date --utc +%FT%T.%3NZ     | $(date --utc +%FT%T.%3NZ)
ISO8601 Local TZ timestamp      | date +%FT%T%Z              | $(date +%FT%T%Z)
YYYY-MM-DD (Short day)          | date +%F\(%a\)             | $(date +%F\(%a\))
YYYY-MM-DD (Long day)           | date +%F\(%A\)             | $(date +%F\(%A\))
EOD

Tuesday, July 19, 2016

JQ (jq) JSON parser for BASH (linux) command line

JQ is awesome tool to traverse through the JSON and present the data the way you like it.
Below $i and $j come from a for loop ($j is arch type) ($i is 0..20) array

jq -r "{ os: .$j|to_entries|values[$i].key, gpu: .$j|to_entries| values[$i].value.null[] }  " /tmp/farm.json

Example JSON:
 {
   "ppc64le" : {                  
       "RHEL7_2" : {              
           "null" : [             
               "gpu1",           
               "gpu2",            
               "gpu3"             
           ]                      
       },                         
       "Ubuntu15_04" : {          
           "null" : null          
       },                         
       "Ubuntu16_04" : {          
           "null" : [             
               "gpu1",           
               "gpu2"             
           ]                      
       }                          
   },                             
   "x86" : {                      
       "FC22" : {                 
           "null" : null          
       },                         
       "FC23" : {                 
           "null" : null          
       }
}                        

FUNCTION

function farm_config_list {                                                                                                               
       echo -e "\n\n------\n- Generating config list \n As of: $(date)\n-------\n"                       
        tool --query farm > /tmp/farm.json \                                                                              
       && sed -i 's/FARM = //g' /tmp/farm.json \                                                                                         
       && for j in aarch64 ARMv7 x86 ppc64le x86_64; \                                                                                        
                do for i in {0..90}; \                                                                                                        
                       do cat /tmp/farm.json |jq -r "{ os: .$j|to_entries|values[$i].key, gpu: .$j|to_entries| values[$i].value.null[] }  " \
                               |tr '\n' ' ' \                                                                                                 
                               |sed -e 's/{/\n{/g' -e 's/"os"/"arch": '"$j"',\t"os"/g' -e 's/{/\t\t{/g';\                                     
                        done; \                                                                                                               
                done 2>/dev/null \                                                                                                            
       |grep -v "jq: error"                                                                                                                   
                                                                                                                                              
}                                                                                                                                             

Wednesday, January 6, 2016

Compiler Desgining

  • Test Next Week
  • This and Next Week are Advising Weeks or Else!!

DATA STRUCTURES
  1. Array ---> Computed Offsets
  2. Object
  3. Dynamic Structures (Linked List)
  4. Union Structure --> Named of sets
  5. Record / Struct -->


  1. Array: 
.
.
.
ARR[5] = 7; Compute
. ADDR ARR ==> B.A + 100  ==> "x"

2. oBJECT
3. dYNAMIC Structures (Link List)
4. UNION Structure
5. Record / Struct
example:
Record Student Record:
NAMEchar[20]    offset is 0
AGEint    offset is 20
GPAFLOAT    offset is 24
..



StudentRecord s;
s.AGE = 14; // what address should be interpreted for AGE (its called Name Offset)
     |
     |
     code to 
complete LHS address?    Lets say X = BaseAddress + 200

 (take X and start adding the sizes of other data types )


Quote of the Day:
"Blowing up is better than getting Garbage" 


The Quote is in reference to dangaling reference pointers.



"Don't step up to the plate unless you'v got sholders"



-= xxx END oF Data Structures xxx =-

ERRORS
- Detection Issues
- Recovery Issues  (when illegal character is found show error and discard) 
- Reporting Issues

Compile Time view Run Time View






Data Structures: Arrays (Dynamic)

Dynamic Arrays:

(1) Can be restricted on the fly.
(2) Size can be specified in terms of a variable. Therefore, not known until run-time.

Q. What do we have to hold space for in every Activation Record.
A. Local variables(usr var's), old program counter (where to return back), base pointer, top pointer, temporary variable (automatically created),


Q. What is a dynamic chain in respect to activation record?
A. when you point back to the environment where you have been called.


Q. What is a "Dope Vector"?
A. Any information we need during the runtime, all the information is stored inside the DopeVector.



Q. What kind of other relevant information be stored in Dope Vector?
A.



Q. If compiler writer was care less, it may lead to garbage issues and memory wasn't de-allocated at the rite time.
A. There has to be appropriate code for de-allocation in the compiler or else how would anyone know the generated code is leading to garbage.



Talked about the resumption model in pl1 (known as try{} catch{} block in .net)

Fortran Flat Memory Model:- is contrasted to the stack memory model.

Fortran didn't support recurssion because of the flat memory model. We know how much memory is required at the compile time. and all the functions. All the varriables are static in nature.


Realization: Students listining in the class what leads to the feedbacks from student. How much does the teacher in class motivates student to input + process. A student motivated by the teacher would have developed a way of inputing and processing, be able to follow the thinking process.
input + processing v.s input only (then Process powerfully)




Blinking LED Source CODE for PIC18F4553 with Bootloader

After so much of painful tries of trying to get a Blink LED source code to work for PIC18f4553... I realized, I could work on the bootloader code and have that darn LED blink on the PortAbits.RN1.

Wednesday, December 23, 2015

Package manager for WINDOWS systems CHOCO CHOCOLETY

Install CHOCO  (open cmd with Admin rights [click cmd with ctrl+shift pressed]
paste the following
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin


Awesome Apps automatically installed
choco install jivkok.tools -y