How to reset git repo to remote origin

git fetch origin —- fetch from origin git reset –hard origin/master — this is the real reset. git clean -f -d **** warning clean will remove all data and directories not tracked. **** so if you have data file or untracked data – it will be gone. **** Not really necessary to really sync the actual code. But it will […]

How to change permissions in git ( Windows )

here is a procedure to change permissions in Windows and or Linux.  Of course, in Linux it picks it up when you add the file for commit git ls-tree HEAD – the first column is the permission in the index.  You have to commit before the index is actually updated. C:\Users\jonallen\Documents\github\weather_obs>git ls-tree HEAD 100644 blob bc24e36afc3ccfa261f3f1bfd16de59c6059b72b KDCA.xml 100644 blob 5998e23e67758e0cf3681c079437f91c8ece445e […]

rpm – how to find packages based on size

rpm -qa –queryformat ‘%10{size} – %-25{name} \t %{version}\n’ | sort -n returns a list – biggest down at bottom ………. 27698421 – binutils 2.29.1 30080231 – vim-common 8.1.1602 30573277 – python-libs 2.7.18 35589262 – scipy 0.12.1 36808072 – gcc-c++ 7.3.1 39563592 – mariadb 10.2.38 42421327 – python3-libs 3.7.10 48556145 – gcc 7.3.1 49102448 – python2-botocore 1.18.6 84934333 – mariadb-server 10.2.38 […]

Pandas – how to edit columns for html table

How to edit table so that index and column names are on the same row. import beatifulsoup. from bs4 import BeautifulSoup find the empty tags in ‘thead’ and then fill with col names from the dataframe. Note: If you code “header=False”, the default style for table row will be gone <tr style=”text-align: right;”> html_doc = tide_table.to_html(header=False) soup = BeautifulSoup(html_doc, ‘html.parser’) […]

Using git to reset file

So, you were editing a file on production machine to debug an issue.  Once you are finished you want to reset it back to what was in git. delete the file. 2. git checkout HEAD <filename> This will restore the file to the last pull or fetch. v( local git repository ) However, when you pull again.  it will show […]