Tagged: howto Toggle Comment Threads | Keyboard Shortcuts

  • diegor 5:15 pm on May 9, 2015 Permalink | Reply
    Tags: , howto   

    HOWTO: Change the message of a pushed commit 

    • git rebase -i
    • In you editor now change ‘pick’ to ‘reword’ on the line for the incorrect commit.
    • Once you have done, save and close.
    • Now the editor opens again with the message to correct. Do your correction, save and close
    • git push –force

    This method will rewrite the history of your repository. If someone pulled/fetched from the repo between the commit with the wrong message and when you correct it, he/she could have some issues. It would be useful to communicate to anyone involved about your action.

  • diegor 10:48 pm on October 5, 2014 Permalink | Reply
    Tags: howto, , , vmware   

    HOWTO: Ctrl/Alt/Shift keys not working in VMWare 

    Sometime when using VMWare under linux, it makes impossible the usage of Ctrl/Alt/Shift keys on the virtualised OS. The solution is quite easy though. Open a terminal and type the following command:

    #> setxkbmap

    That’s it.

  • diegor 10:23 am on August 28, 2014 Permalink | Reply
    Tags: howto,   

    HOWTO: check if I am in a screen session 

    #> echo $STY

    If you are in a screen session, you’ll see something similar to

    #> echo $STY

    If you aren’t, you’ll see nothing.

    #> echo $STY

  • diegor 5:03 pm on August 14, 2014 Permalink | Reply
    Tags: , howto   

    HOWTO: restore a deleted file in git 

    #> git rev-list -n 1 HEAD -- path_to_file  #this gives you the commit's hash
    #> git checkout commit_hash^ -- path_to_file # it restores the file

  • diegor 10:26 am on July 18, 2014 Permalink | Reply
    Tags: howto,   

    HOWTO: rename screen session 

    Within screen:

    C-a :sessionname newSessionName

    where C-a is Ctrl-a

    Without attaching a screen session:

    #> screen -X sessionname newSessionName

    If you have multiple screen running you have to specify which one to rename:

    #> screen -S sessionToRename -X sessionname newSessionName

  • diegor 6:44 pm on June 19, 2014 Permalink | Reply
    Tags: howto,   

    HOWTO: schedule repeating events with Python 

    import sched
    import datetime, time
    class PeriodicScheduler(object):                                                
        def __init__(self):                                                         
            self.scheduler = sched.scheduler(time.time, time.sleep)                 
        def setup(self, interval, action, actionargs=()):                           
            self.scheduler.enter(interval, 1, self.setup,                           
                            (interval, action, actionargs))                         
        def run(self):                                                              
    #This is the event to execute every time
    def periodic_event():
        print datetime.datetime.now()
    INTERVAL = 1 # every second
    periodic_scheduler = PeriodicScheduler() 
    periodic_scheduler.setup(INTERVAL, periodic_event) # it executes the event just once
    periodic_scheduler.run() # it starts the scheduler

  • diegor 6:40 pm on April 2, 2014 Permalink | Reply
    Tags: , howto   

    HOWTO: move a commit to another branch using GIT 

    #> git log #Get the commit_ID that you want to move
    #> git checkout [right_branch]
    #> git cherry-pick [commit_ID]

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc