Skip to content

Instantly share code, notes, and snippets.

View cobrce's full-sized avatar
🎯
Focusing

cob_258 cobrce

🎯
Focusing
View GitHub Profile
@tarolandia
tarolandia / steps
Created May 5, 2013 02:30
Disable sync flag when mounting an External HDD to your raspberry pi (xBian)
sudo vi /etc/usbnount/usbmount.conf
...
MOUNTOPTIONS="sync,noexec,nodev,noatime,nodiratime,rw"
...
remove sync flag and save the file
...
@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

@mandiwise
mandiwise / Update remote repo
Last active June 21, 2024 13:14
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@Kirkkt
Kirkkt / git diff ignoring certain files.md
Last active November 6, 2023 12:36
git diff ignoring certain files

git diff ignoring certain files

What is this?

Sometimes you want to ignore certain files when you run git diff, but you still want to check them in, which means you can't capitalize on .gitignore.

This guide is here to help.

How to set it up?

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@didasy
didasy / fast_pwm.ino
Created January 14, 2017 18:16
Fast PWM for ATMega328
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
pinMode(3, OUTPUT); // output pin for OCR2B, this is Arduino pin number
// In the next line of code, we:
// 1. Set the compare output mode to clear OC2A and OC2B on compare match.
// To achieve this, we set bits COM2A1 and COM2B1 to high.
@nnaumenko
nnaumenko / mc7.md
Last active February 13, 2024 17:19
Simatic MC7 code
@gmolveau
gmolveau / firefox_dark_background.md
Last active May 25, 2024 15:59
Firefox dark background / theme for new tab and loading screen

Firefox Dark Background

  • How to change the background on Firefox to a dark one on new tab / loading screen ?

Procedure

  • Type about:config in the URL bar
  • Search toolkit.legacyUserProfileCustomizations.stylesheets and double-click the field to set it to true
  • Type about:support in the URL bar
  • Look for Profile folder field and click on the open button next to it.
@vanbwodonk
vanbwodonk / read-stm32-firnware.md
Last active March 11, 2024 17:41
Read stm32 firmware binary with openOCD

read-stm32-firmware

OpenOCD scripts for read STM32 firmware binary

Requirements

Linux

OpenOCD (Open On-Chip Debugger) is open-source software that interfaces with a hardware debugger's JTAG port. OpenOCD provides debugging and in-system programming for embedded target devices. OpenOCD provides the ability to flash NAND and NOR FLASH memory devices that are attached to the processor on the target system. Flash programming is supported for external CFI compatible flashes (Intel and AMD/Spansion command set) and several internal flashes (LPC2000, AT91SAM7, STR7x, STR9x, LM3 and STM32x).

OpenOCD was originally developed by Dominic Rath at the University of Applied Sciences Augsburg. The OpenOCD source code is now available through the GNU General Public License (GPL).