Wednesday, June 9, 2021

Assembly code

Assembly code with examples:

---

stepi ---  Step each instruction:

 

-----

lea -- assembly code operation

lea    -0x40(%rbp),%rcx
(gdb) info registers rbp
rbp            0x7fd1cd6fc850   0x7fd1cd6fc850
(gdb) info registers rcx
rcx            0x7fd1cd6fc810   140539071547408
(gdb) p/x 0x7fd1cd6fc850- 0x40
$19 = 0x7fd1cd6fc810 

----

lea (%rdi, %rdi, 4), %rax  # set %rax to %rdi + %rdi * 4

(gdb) p/x $rax + $rcx * 8
$14203 = 0x480
(gdb) p/x $rbx
$14197 = 0x480
(gdb) p/x $rax
$14198 = 0x0  
(gdb) p/x $rcx
$14199 = 0x90
 0x0000560e660e05ab <+267>:   lea    (%rax,%rcx,8),%rbx

-----

Display current instruction:

(gdb) disp/i $pc
1: x/i $pc
=> 0x55fc7df2e297 <func [__be_func...]+39>: mov    %rax,%rdi

------

Display 10 instructions from current instruction:

----------

(gdb) x/10i $pc

Monday, March 8, 2021

Virtual Machine

 Loading Centos:

https://getlabsdone.com/10-easy-steps-to-install-centos-7-8-on-vmware-workstation/

Friday, July 31, 2020

Dynamic programming


DATA structures:

m-trees:
https://stackoverflow.com/questions/4872969/practical-use-of-m-way-tree


Reference:
https://www.techiedelight.com/introduction-dynamic-programming/

Wednesday, February 22, 2017

Apple mac

To put back multiples files from Trash:

Open apple script editor and copy paste following code and run.

repeat 5 times --or as many files you have
    tell application "Finder" to open trash --open the trash folder
    tell application "Finder" to activate
    tell application "System Events"
        tell process "Finder"
            delay 0.2 -- adjust delay as needed
            key code 125 --move down to get focus on a file
            key down command --hold command key
            delay 0.2 -- adjust delay as needed
            key code 51 --hit delete
            key up command --release command
        end tell
    end tell
    delay 0.2 -- adjust delay as needed
    tell application "Finder" to close every window --close everything for the next cycle
end repeat

 Flash drive/USB not recognized for macbook pro:

This method solves the issue after the drive is formatted and reconnected to the system. In order to do that, here are the steps;

1 – Press Command + Spacebar and connect the flash drive.

2 – Open Application and click on Disk Utility Option

3 – Select the Flash Drive on the left pane.

4 – Click on Erase button to complete the process                           




Reference:
https://www.remosoftware.com/info/fix-flash-drive-not-recognized-mac-windows
https://forums.macrumors.com/threads/batch-put-back-files-from-trash-to-original-location.1573914/

Monday, May 11, 2015

EAP


On EAP(yet start)


References:
https://sites.google.com/site/amitsciscozone/home/switching/peap---protected-eap-protocol

Sunday, December 21, 2014

Firefox

about:config
1. "browser.search.showOneOffButtons == false" to set old searchbar. Which can be navigated through Ctrl+ up/down

Links:
https://support.mozilla.org/en-US/questions/1035085

Thursday, June 26, 2014

Microsoft Excel

1. Take in a cell display in multiple lines: Alt-Enter.

2. Create new row:
    Alt + i + r
    shift + space and Keyboard Right-Click Key +  i
    Ctrl + shift + + -- add row/column
    Ctrl + -  -- delete row/column
    To repeat same action again, press F4 so that you can create multiple rows.
3.  To freeze the header
      View =>"Freeze Panes"
4. To manually select the options on a cells
     alt + pagedown + tab + scroll with arrow keys + select



References:
http://spreadsheetpage.com/index.php/tip/display_text_in_multiple_lines (1)
http://www.howtogeek.com/208342/how-do-i-insert-a-new-row-in-excel-via-the-keyboard (2)
http://superuser.com/questions/59872/fixing-the-first-row-as-sortable-title-in-excel-2007 (3)
 http://superuser.com/questions/178222/excel-keyboard-shortcut-to-move-swap-column-left-or-right#comment780862_626902