Skip to content

Commit

Permalink
how to add secrets to macOS keychain
Browse files Browse the repository at this point in the history
+ how to move already committed git files to git LFS
+ fix beamer xcolor bug in ubuntu 22.04
  • Loading branch information
pranabdas committed Oct 15, 2023
1 parent c62d61a commit 342f7ce
Show file tree
Hide file tree
Showing 8 changed files with 1,397 additions and 1,121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Prepare Node environment
uses: actions/setup-node@v3
Expand Down
12 changes: 12 additions & 0 deletions docs/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,19 @@ not-actual-project-code/* linguist-vendored
More info [here](
https://github.com/github/linguist/blob/master/docs/overrides.md).

### Move already committed files to git LFS

Find the commit SHA where the file was added, we need to hash of the commit
before it (say `eafcece98d772c14a16`). Find more info [here](
https://hlung.medium.com/migrating-committed-files-to-git-lfs-the-quick-way-7be728e103ff)
and [here](https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-migrate.adoc).

```bash
git lfs migrate import --verbose --include="*.pdf" --include-ref=HEAD --exclude-ref=eafcece98d772c14a16
```

## Resources

- <https://git-scm.com/book/en/v2>
- <https://github.com/pluralsight/git-internals-pdf>
- [Removing sensitive data from Git/GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository)
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ to get a quick summary of various Linux/ UNIX commands.
- [Privacy and security tips](privacy.md)
- [LaTeX](latex.md)
- [Windows Subsystem for Linux](wsl.md)
- [More tips and tricks](more-tips-tricks.md)
+ [Resources](resources.md)
+ [License](license.md)
30 changes: 29 additions & 1 deletion docs/latex.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,46 @@
title: LaTeX
keywords: ["latex setup", "texlive setup", "texlive installation in ubuntu", "latex installation in ubuntu"]
---

### Installation in Ubuntu/Debian

```bash
sudo apt install -y --no-install-recommends \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-extra \
texlive-science \
texlive-pictures \
texlive-luatex
texlive-luatex \
texinfo \
python3 \
python3-pygments \
ghostscript
```

### Fix beamer xcolor bug in Ubuntu 22.04

There is a beamer bug in `v3.65` (shipped with Ubuntu 22.04): named colors are
not recognized. The bug was fixed in beamer `v3.66`. Below script replaces the
buggy beamer version:

```bash
CWD=${PWD}
sudo apt install --no-install-recommends unzip wget
cd /tmp
mkdir beamer && cd $_
wget https://file-storage.github.io/downloads/beamer.tds-v3.68.zip
unzip beamer.tds-v3.68.zip
cd tex/latex
sudo mv /usr/share/texlive/texmf-dist/tex/latex/beamer /usr/share/texlive/texmf-dist/tex/latex/beamer.bak
sudo cp -a beamer /usr/share/texlive/texmf-dist/tex/latex
cd /tmp
rm -rf beamer
cd ${CWD}
```

### Misc

- Various Fira font weights: `\firathin`, `\firaultralight`, `\firaextralight`,
`\firalight`, `\firabook`, `\firamedium`, `\firasemibold`, `\firaextrabold`,
`\firaheavy`.
Expand Down
23 changes: 23 additions & 0 deletions docs/more-tips-tricks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: More tips and tricks
---

### Store ENV variables in macOS keychain

Add item to keychain:

```bash
security add-generic-password -a "$USER" -s 'API_KEY' -w 'xxxxyyyyzzzz'
```

Get secret from keychain:

```bash
security find-generic-password -a "$USER" -s 'API_KEY' -w
```

Automatically export secret variables via `.zshrc` or `.bashrc`:

```bash
export API_KEY=$(security find-generic-password -a "$USER" -s "API_KEY" -w)
```

0 comments on commit 342f7ce

Please sign in to comment.