Folder size
du -h <your_directory>
grep .css file for color codes:
grep -E '#[[:digit:]]{3,6}' style.light-blue-500.css
grep -E '#[[:digit:]]{3,6}' style.light-blue-500.css | sort --unique
# pipe unique output into new file called `main-colors.css`
grep -E '(#[[:digit:]]{3,6})' style.light-blue-500.css | sort --unique > main-colors.css
grep -E '(#[[:alnum:]]{3,6})' style.light-blue-500.css | sort --unique > main-colors-2.css
Delete last number of commits
git reset --hard HEAD~1
# or
git reset --hard <sha1-commit-id>
# sync with remote
git push origin HEAD --force
https://www.freecodecamp.org/news/git-delete-branch-how-to-remove-a-local-or-remote-branch/
Delete local
git branch -d < local_branch_name >
Force delete local
git branch -D < local_branch_name >
git remote -v
git remote set-url origin https://github.com/YOUR-USERNAME/YOUR-REPO.git
git remote set-url origin git@github.com:< username >/< repo >.git
Show github repo url.
git remote show origin
Clear single item from cache.
git rm --cached products.csv
Clear all items from cache.
git rm -r --cached .
# re-add and commit items
git add .
git commit -m 'git cache cleared'
git push
Track repo from clone.
git checkout --track origin/develop
# or
git checkout --track -b origin/feature/branch-name
Create new branch and change to that branch.
git checkout -b develop
https://www.howtogeek.com/devops/how-to-view-commit-history-with-git-log/
https://stackoverflow.com/questions/7124914/how-to-search-a-git-repository-by-commit-message#7124949
Show which files affected.
git log --stat
# or
git log --stat -p
Filter by date range.
git log --after="2014-7-1" --before="2014-7-4"
Filter by file.
git log -- example.json
By commit hash
git show e9d802bdc3a61943b2c9c736194a202b4e000180
https://cli.github.com/manual/gh_repo
Failed commands cause entire script to fail
#/bin/bash
set -e
#/bin/bash
set -u
: "$VERSION"
: "$ARM_CLIENT_ID"
: "$ARM_CLIENT_SECRET"
: "$ARM_TENANT_ID"
: "$ARM_SUBSCRIPTION_ID"
pdftk
, pdfunite
, or ghostscript
. Here's how:pdfunite
is the simplest and fastest for merging PDFs.pdftk
offers more advanced options like rotating, splitting, and encrypting PDFs.ghostscript
is very powerful and can handle complex PDF operations but has more verbose commands.pdfunite
(Easy and Pre-installed on Many Systems)pdfunite
:sudo apt install poppler-utils # Ubuntu/Debian
sudo yum install poppler-utils # CentOS/RHEL
brew install poppler # macOS
pdfunite file1.pdf file2.pdf file3.pdf merged_output.pdf
pdftk
Install pdftk
:
sudo apt install pdftk # Ubuntu/Debian
brew install pdftk-java # macOS
Merge PDFs:
pdftk file1.pdf file2.pdf file3.pdf cat output merged_output.pdf
ghostscript
sudo apt install ghostscript # Ubuntu/Debian
brew install ghostscript # macOS
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged_output.pdf file1.pdf file2.pdf file3.pdf
# install unrar
sudo pacman -Syu unrar
De-compress .rar file
unrar e <file_name>.rar
Extract to location
unrar e <file_name>.rar /home/
Extract with original dir structure
unrar x <file_name>.rar
List file in .rar
unrar l <file_name>.rar
Test integrity of file
unrar t <file_name>.rar
Create rar file
rar a <rar_to_create>.rar <dir_to_compress>
Delete file from archive
rar d filename.rar
compress:
zip -r archivename.zip directory_name
decompress:
tar -zxvf filename.tgz
decompress:
tar -zxvf filename.tar.gz
decompress:
tar -jxvf filename.tar.bz2
compress:
tar cjvf <output_file_name>.tar.bz2 ./<dir_with_files_to_compress>
# others
tar -zxvf filename.tgz -C /path/to/dir1/
tar -zxvf filename.tar.gz /dir2/
tar -jxvf filename.tar.bz2 /path/to/dir3
sudo pacman -Syu calibre
ebook-convert book_name.epub book_name.pdf
# Flags
-v: Sort the output by version.
-r:Sort the output in reverse alphabetic order.
-t: Sort the output by last modification time instead of alphabetically.
-p: Print the file type and permissions for each file (same as ls -l).
-u: Print the username, or UID (if no username is available) of the file.
-s: Print the size of each file in bytes along with the name.
-D: Print the date of the last modification time for the file listed.
# List dir with hidden files
tree -a directory/
# Colorize output
tree -C directory/
# List by regex filename match
tree -P *fname -a
# List by directory depth
tree -d -L 2
List dir structure without output.
$ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
create_dockerfile_dgo() {
# ~/Dockerfile at project root directory.
touch $dockerfile
printf \
"FROM python:3.9
WORKDIR /app
ADD requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# RUN pip install -vvv uvloop
ADD backend backend
ADD main.py .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"]
" > $dockerfile
}
create_test_config() {
# ~/tests
mkdir $base_dir_tests
touch $base_dir_tests/$init
# ~/tests/conftest.py
touch $base_dir_tests/$conftest
touch $base_dir_tests/test_one.py $base_dir_tests/test_two.py
# ~/setup.cfg
touch $setup_cfg
printf \
"[coverage:run]
branch = True
# define paths to omit, comma separated
omit = */.virtualenvs/*,~/.virtualenvs,./backend/utils/*,./backend/config/*
[coverage:report]
show_missing = True
skip_covered = True
[coverage:html]
directory = tests/coverage_html_report
[tool:pytest]
addopts =
--cov backend/
--cov-report html
--verbose
-p no:warnings
testpaths =
tests
filterwarnings = ignore::DeprecationWarning
" > $setup_cfg
}
create_startup_and_test_script() {
# ~/startup.sh
touch $startup
printf \
"export SECRET='<hex hash>'
export MONGO_URI='<mongo uri>'
export WHICH_LOGGER=uvicorn
export ENV_NAME=development
export PORT=5000
uvicorn main:app --port $PORT --reload
run_tests() {
py.test -s tests/test_one.py
py.test -s tests/test_two.py
}
run_docker_local_test() {
docker build -t fastapi_app:latest .
docker run --name test-container -p 5000:5000 fastapi_app:latest
}
" > $startup
}
Key Bindings:
Config file instructions:
Install:
sudo pacman -Syu zathura zathura-poppler
zathura-poppler:
~/.config/zathura/zathurarc
or /etc/zathurarc
.(a)
(s)
(r)
(d)
and has a fullscreen mode.(C-r)
.Links
can be followed by clicking them
.
f
to highlight all links on the page
and assign them a number
typing the number of the link
and pressing enter
will then jump to the link's location
.F
is used, only the location of the link
will be shown in the status bar.zathura can search for text and copy text to the primary X selection.
It supports bookmarks and can open encrypted files.
The behavior and appearance of zathura can be customised using a configuration file.
zathura has the ability to execute external shell commands.
It can be opened in tabs using tabbed.
zathura provides an optional sandbox mode by using seccomp filter to provide a hardened runtime environment.
Table of Contents (Index):
tab
: opens table of contents
tab
button.h
, j
, k
, l
(l
and h
drill down and collapse nested bookmarks
).bookmarks
here, zathura calls the index
bookmarks
are like actual bookmarks:
bmark
to create a bookmark while reading a PDF and view the bookmarks they create later using blist
.Bookmarks:
:blist
shows all bookmarks.:bmark
Creates a new bookmark.enter
~/.local/share/zathura/bookmarks
zathuraconfigrc
database:
Highlight-color:
Example Config:
#set font "Operator Mono Medium 13"
set font "inconsolata 15"
#set default-fg "#B2BEBF"
#set default-bg "#1E282C"
#set statusbar-fg "#566166"
#set statusbar-bg "#242E32"
#set inputbar-fg "#B98675"
#set inputbar-bg "#242E32"
### Testing config from https://hleb.dev/post/zathura/
#open files in maximized window
set window-height 3000
set window-width 3000
# copy selection to system clipboard
set selection-clipboard clipboard
#stop at page boundries
set scroll-page-aware "true"
set smooth-scroll "true"
set scroll-full-overlap 0.01
set scroll-step 100
#setup dark theme
set default-bg "#000000"
set default-fg "#F7F7F6"
set statusbar-fg "#B0B0B0"
set statusbar-bg "#202020"
set inputbar-bg "#151515"
set inputbar-fg "#FFFFFF"
set notification-error-bg "#AC4142"
set notification-error-fg "#151515"
set notification-warning-bg "#AC4142"
set notification-warning-fg "#151515"
set highlight-color "#F4BF75"
set highlight-active-color "#6A9FB5"
set completion-highlight-fg "#151515"
set completion-highlight-bg "#90A959"
set completion-bg "#303030"
set completion-fg "#E0E0E0"
set notification-bg "#90A959"
set notification-fg "#151515"
set recolor "true"
set recolor-lightcolor "#000000"
set recolor-darkcolor "#E0E0E0"
set recolor-reverse-video "true"
set recolor-keephue "true"
set render-loading "false"
.config/zathura/zathurarc
set selection-clipboard clipboard
set font "Operator Mono Medium 13"
set default-fg "#B2BEBF"
set default-bg "#1E282C"
set statusbar-fg "#566166"
set statusbar-bg "#242E32"
set inputbar-fg "#B98675"
set inputbar-bg "#242E32"
set statusbar-h-padding 0
set statusbar-v-padding 0
set page-padding 1
map u scroll half-up
map d scroll half-down
map D toggle_page_mode
map r reload
map R rotate
map K zoom in
map J zoom out
map i recolor
map p print
Function | Description |
---|---|
abort | Switch back to normal mode |
adjust_window | Adjust page width |
change_mode | Change current mode |
display_link | Display link target |
focus_inputbar | Focus inputbar |
follow | Follow a link |
goto | Go to a certain page |
jumplist | Move forwards/backwards in the jumplist |
navigate | Navigate to the next/previous page |
navigate_index | Navigate through the index |
Show the print dialog | |
quit | Quit zathura |
recolor | Recolor the pages |
reload | Reload the document |
rotate | Rotate the page |
scroll | Scroll |
search | Search next/previous item |
set | Set an option |
toggle_fullscreen | Toggle fullscreen |
toggle_index | Show or hide index |
toggle_inputbar | Show or hide inputbar |
toggle_page_mode | Toggle between one and multiple pages per row |
toggle_statusbar | Show or hide statusbar |
zoom | Zoom in or out |
Download Abiword from Ubuntu Software Center or you can install it by typing following command in terminal:
Install:
sudo apt-get install abiword
convert .pdf to .doc
abiword --to=doc example.pdf
https://www.tecmint.com/install-dig-and-nslookup-in-linux/#digarch
sudo pacman -Syu bind-tools
dig -v
#or
dnsutils
list usb devices
lsusb
Add and remove modules from your systems linux kernal
modprobe
Reload mouse
modprobe -r psmouse && modprobe psmouse proto=imps
modinfo uinput
cat /proc/bus/input/devices
Utility for displaying info about PCI buses in your system.
As well as the devices connected to them.
Shows if system recognizes hardware.
lspci -k
hwinfo
View system device information by bus, class, and topology
Calling systool without parameters will present all available bus types, device classes, and root devices.
When device is supplied, the information reqested by options is shown only for the specified device, otherwise all present devices are displayed.
systool uses APIs provided by libsysfs to gather information.
dmesg (diagnostic message[1]) is a command on most Unix-like operating systems that prints the message buffer of the kernel.
The output of this command typically contains the messages produced by the device drivers.
Tells you if any firmware is missing.
dmesg | grep -i firmware
xinput --list
locate synaptics | grep xorg
### Q:
- Does system recognize hardware?
- Are drivers installed?
synclient -l
synclient TouchpadOff=1
# Remove and then reload psmouse from kernal.
modprobe -r psmouse #psmouse happens to be the kernel module for my touchpad (Alps DualPoint)
modprobe psmouse
$ xinput --list-props 12 | grep "Device Node"
Device Node (291): "/dev/input/event6"
xrandr --output eDP1 --mode 1920x1080
error: failed retrieving file 'core.db' from mirror.rackspace.com : Could not resolve host: mirror.rackspace.com
sudo pacman-key --populate arcolinux
sudo pacman-key --refresh-keys
sudo pacman -S archlinux-keyring
sudo pacman-key --init && sudo pacman-key --populate arcolinux
nameservers:
https://servers.opennicproject.org/
tor buddy:
https://www.youtube.com/watch?v=lJQyxNxcGNQ&list=PLYV45E82CBTEV4QyjVD5ntvci0mPmdGue&index=6&t=0s
sudo pacman -Syu tor
sudo pacman -Syu torbrowser-launcher
# This is the configuration for libtorsocks (transparent socks) for use
# with tor, which is providing a socks server on port 9050 by default.
#
# Lines beginning with # and blank lines are ignored
# Much more documentation than provided in these comments can be found in
#
# torsocks.conf(5), torsocks(1) and torsocks(8) manpages.
# Default Tor address and port. By default, Tor will listen on localhost for
# any SOCKS connection and relay the traffic on the Tor network.
TorAddress 127.0.0.1
TorPort 9050
# Tor hidden sites do not have real IP addresses. This specifies what range of
# IP addresses will be handed to the application as "cookies" for .onion names.
# Of course, you should pick a block of addresses which you aren't going to
# ever need to actually connect to. This is similar to the MapAddress feature
# of the main tor daemon.
OnionAddrRange 127.42.42.0/24
# SOCKS5 Username and Password. This is used to isolate the torsocks connection
# circuit from other streams in Tor. Use with option IsolateSOCKSAuth (on by
# default) in tor(1). TORSOCKS_USERNAME and TORSOCKS_PASSWORD environment
# variable overrides these options.
#SOCKS5Username <username>
#SOCKS5Password <password>
# Set Torsocks to accept inbound connections. If set to 1, listen() and
# accept() will be allowed to be used with non localhost address. (Default: 0)
#AllowInbound 1
# Set Torsocks to allow outbound connections to the loopback interface.
# If set to 1, connect() will be allowed to be used to the loopback interface
# bypassing Tor. If set to 2, in addition to TCP connect(), UDP operations to
# the loopback interface will also be allowed, bypassing Tor. This option
# should not be used by most users. (Default: 0)
#AllowOutboundLocalhost 1
# Set Torsocks to use an automatically generated SOCKS5 username/password based
# on the process ID and current time, that makes the connections to Tor use a
# different circuit from other existing streams in Tor on a per-process basis.
# If set, the SOCKS5Username and SOCKS5Password options must not be set.
# (Default: 0)
#IsolatePID 1
# proxychains.conf VER 3.1
#
# HTTP, SOCKS4, SOCKS5 tunneling proxifier with DNS.
#
# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
# https://www.youtube.com/watch?v=AedFlLSmJf8
dynamic_chain
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
#strict_chain
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
#random_chain
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see chain_len) from the list.
# this option is good to test your IDS :)
# Make sense only if random_chain
#chain_len = 2
# Quiet mode (no output from library)
#quiet_mode
# Proxy DNS requests - no leak for DNS data
# If using https://sourceforge.net/projects/linuxscripts/ tor buddy. disable this otherwisw keep enbled.
proxy_dns#Disable when using tor-buddy
# Some timeouts in milliseconds
tcp_read_time_out 15000
tcp_connect_time_out 8000
# ProxyList format
# type host port [user pass]
# (values separated by 'tab' or 'blank')
#
#
# Examples:
#
# socks5 192.168.67.78 1080 lamer secret
# http 192.168.89.3 8080 justu hidden
# socks4 192.168.1.49 1080
# http 192.168.39.93 8080
#
#
# proxy types: http, socks4, socks5
# ( auth types supported: "basic"-http "user/pass"-socks )
#
[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
socks4 127.0.0.1 9050
socks5 127.0.0.1 9050
## Configuration file for a typical Tor user
## Last updated 9 October 2013 for Tor 0.2.5.2-alpha.
## (may or may not work for much older or much newer versions of Tor.)
##
## Lines that begin with "## " try to explain what's going on. Lines
## that begin with just "#" are disabled commands: you can enable them
## by removing the "#" symbol.
##
## See 'man tor', or https://www.torproject.org/docs/tor-manual.html,
## for more options you can use in this file.
##
## Tor will look for this file in various places based on your platform:
## https://www.torproject.org/docs/faq#torrc
## Tor opens a socks proxy on port 9050 by default -- even if you don't
## configure one below. Set "SocksPort 0" if you plan to run Tor only
## as a relay, and not make any local application connections yourself.
#SocksPort 9050 # Default: Bind to localhost:9050 for local connections.
#SocksPort 192.168.0.1:9100 # Bind to this address:port too.
## Entry policies to allow/deny SOCKS requests based on IP address.
## First entry that matches wins. If no SocksPolicy is set, we accept
## all (and only) requests that reach a SocksPort. Untrusted users who
## can access your SocksPort may be able to learn about the connections
## you make.
#SocksPolicy accept 192.168.0.0/16
#SocksPolicy reject *
## Logs go to stdout at level "notice" unless redirected by something
## else, like one of the below lines. You can have as many Log lines as
## you want.
##
## We advise using "notice" in most cases, since anything more verbose
## may provide sensitive information to an attacker who obtains the logs.
##
## Send all messages of level 'notice' or higher to /var/log/tor/notices.log
#Log notice file /var/log/tor/notices.log
## Send every possible message to /var/log/tor/debug.log
#Log debug file /var/log/tor/debug.log
## Use the system log instead of Tor's logfiles
#Log notice syslog
## To send all messages to stderr:
#Log debug stderr
## Uncomment this to start the process in the background... or use
## --runasdaemon 1 on the command line. This is ignored on Windows;
## see the FAQ entry if you want Tor to run as an NT service.
#RunAsDaemon 1
## The directory for keeping all the keys/etc. By default, we store
## things in $HOME/.tor on Unix, and in Application Data\tor on Windows.
#DataDirectory /var/lib/tor
## The port on which Tor will listen for local connections from Tor
## controller applications, as documented in control-spec.txt.
ControlPort 9051
## If you enable the controlport, be sure to enable one of these
## authentication methods, to prevent attackers from accessing it.
#HashedControlPassword 16:872860B76453A77D60CA2BB8C1A7042072093276A3D701AD684053EC4C
#CookieAuthentication 1
############### This section is just for location-hidden services ###
## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.
#HiddenServiceDir /var/lib/tor/hidden_service/
#HiddenServicePort 80 127.0.0.1:80
#HiddenServiceDir /var/lib/tor/other_hidden_service/
#HiddenServicePort 80 127.0.0.1:80
#HiddenServicePort 22 127.0.0.1:22
################ This section is just for relays #####################
#
## See https://www.torproject.org/docs/tor-doc-relay for details.
## Required: what port to advertise for incoming Tor connections.
#ORPort 9001
## If you want to listen on a port other than the one advertised in
## ORPort (e.g. to advertise 443 but bind to 9090), you can do it as
## follows. You'll need to do ipchains or other port forwarding
## yourself to make this work.
#ORPort 443 NoListen
#ORPort 127.0.0.1:9090 NoAdvertise
## The IP address or full DNS name for incoming connections to your
## relay. Leave commented out and Tor will guess.
#Address noname.example.com
## If you have multiple network interfaces, you can specify one for
## outgoing traffic to use.
# OutboundBindAddress 10.0.0.5
## A handle for your relay, so people don't have to refer to it by key.
#Nickname ididnteditheconfig
## Define these to limit how much relayed traffic you will allow. Your
## own traffic is still unthrottled. Note that RelayBandwidthRate must
## be at least 20 KB.
## Note that units for these config options are bytes per second, not bits
## per second, and that prefixes are binary prefixes, i.e. 2^10, 2^20, etc.
#RelayBandwidthRate 100 KB # Throttle traffic to 100KB/s (800Kbps)
#RelayBandwidthBurst 200 KB # But allow bursts up to 200KB/s (1600Kbps)
## Use these to restrict the maximum traffic per day, week, or month.
## Note that this threshold applies separately to sent and received bytes,
## not to their sum: setting "4 GB" may allow up to 8 GB total before
## hibernating.
##
## Set a maximum of 4 gigabytes each way per period.
#AccountingMax 4 GB
## Each period starts daily at midnight (AccountingMax is per day)
#AccountingStart day 00:00
## Each period starts on the 3rd of the month at 15:00 (AccountingMax
## is per month)
#AccountingStart month 3 15:00
## Administrative contact information for this relay or bridge. This line
## can be used to contact you if your relay or bridge is misconfigured or
## something else goes wrong. Note that we archive and publish all
## descriptors containing these lines and that Google indexes them, so
## spammers might also collect them. You may want to obscure the fact that
## it's an email address and/or generate a new address for this purpose.
#ContactInfo Random Person <nobody AT example dot com>
## You might also include your PGP or GPG fingerprint if you have one:
#ContactInfo 0xFFFFFFFF Random Person <nobody AT example dot com>
## Uncomment this to mirror directory information for others. Please do
## if you have enough bandwidth.
#DirPort 9030 # what port to advertise for directory connections
## If you want to listen on a port other than the one advertised in
## DirPort (e.g. to advertise 80 but bind to 9091), you can do it as
## follows. below too. You'll need to do ipchains or other port
## forwarding yourself to make this work.
#DirPort 80 NoListen
#DirPort 127.0.0.1:9091 NoAdvertise
## Uncomment to return an arbitrary blob of html on your DirPort. Now you
## can explain what Tor is if anybody wonders why your IP address is
## contacting them. See contrib/tor-exit-notice.html in Tor's source
## distribution for a sample.
#DirPortFrontPage /etc/tor/tor-exit-notice.html
## Uncomment this if you run more than one Tor relay, and add the identity
## key fingerprint of each Tor relay you control, even if they're on
## different networks. You declare it here so Tor clients can avoid
## using more than one of your relays in a single circuit. See
## https://www.torproject.org/docs/faq#MultipleRelays
## However, you should never include a bridge's fingerprint here, as it would
## break its concealability and potentionally reveal its IP/TCP address.
#MyFamily $keyid,$keyid,...
## A comma-separated list of exit policies. They're considered first
## to last, and the first match wins. If you want to _replace_
## the default exit policy, end this with either a reject *:* or an
## accept *:*. Otherwise, you're _augmenting_ (prepending to) the
## default exit policy. Leave commented to just use the default, which is
## described in the man page or at
## https://www.torproject.org/documentation.html
##
## Look at https://www.torproject.org/faq-abuse.html#TypicalAbuses
## for issues you might encounter if you use the default exit policy.
##
## If certain IPs and ports are blocked externally, e.g. by your firewall,
## you should update your exit policy to reflect this -- otherwise Tor
## users will be told that those destinations are down.
##
## For security, by default Tor rejects connections to private (local)
## networks, including to your public IP address. See the man page entry
## for ExitPolicyRejectPrivate if you want to allow "exit enclaving".
##
#ExitPolicy accept *:6660-6667,reject *:* # allow irc ports but no more
#ExitPolicy accept *:119 # accept nntp as well as default exit policy
#ExitPolicy reject *:* # no exits allowed
## Bridge relays (or "bridges") are Tor relays that aren't listed in the
## main directory. Since there is no complete public list of them, even an
## ISP that filters connections to all the known Tor relays probably
## won't be able to block all the bridges. Also, websites won't treat you
## differently because they won't know you're running Tor. If you can
## be a real relay, please do; but if not, be a bridge!
#BridgeRelay 1
## By default, Tor will advertise your bridge to users through various
## mechanisms like https://bridges.torproject.org/. If you want to run
## a private bridge, for example because you'll give out your bridge
## address manually to your friends, uncomment this line:
#PublishServerDescriptor 0
Ranger like terminal file browser.
terminal file browser.
exec_always --no-startup-id ~/.config/polybar/launch.sh &
#!/usr/bin/env sh
# More info : https://github.com/jaagr/polybar/wiki
# Install the following applications for polybar and icons in polybar if you are on ArcoLinuxD
# awesome-terminal-fonts
# Tip : There are other interesting fonts that provide icons like nerd-fonts-complete
# --log=error
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar > /dev/null; do sleep 1; done
desktop=$(echo $DESKTOP_SESSION)
count=$(xrandr --query | grep " connected" | cut -d" " -f1 | wc -l)
case $desktop in
i3|/usr/share/xsessions/i3)
if type "xrandr" > /dev/null; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$m polybar --reload mainbar-i3 -c ~/.config/polybar/config.ini &
done
else
polybar --reload mainbar-i3 -c ~/.config/polybar/config.ini &
fi
# second polybar at bottom
# if type "xrandr" > /dev/null; then
# for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
# MONITOR=$m polybar --reload mainbar-i3-extra -c ~/.config/polybar/config.ini &
# done
# else
# polybar --reload mainbar-i3-extra -c ~/.config/polybar/config.ini &
# fi
;;
esac
[module/pacman-updates]
type = custom/script
exec = pacman -Qu | wc -l
; exec = checkupdates | wc -l
interval = 1000
label = Repo: %output%
format-foreground = ${colors.foreground}
format-background = ${colors.background}
format-prefix = " "
format-prefix-foreground = #FFBB00
format-underline = #FFBB00
Files involved:
~.Xresources
xrdb -merge ~/.Xresources
to apply changes.!Xft.dpi: 144
Xft.dpi: 110
!Xft.dpi: 120
!Xft.dpi: 96
~/.config/gtk-3.0/settings.ini
[Settings]
gtk-font-name=Sans 11
gtk-dpi=144
gtk-xft-dpi=144000
gtk-enable-animations=false
gtk-primary-button-warps-slider=false
This issue might be related to scaling or resolution changes after the update. Here are a few ways to potentially fix it:
Check Display Settings: Ensure your display resolution is set correctly after the update. Sometimes, updates might reset display configurations. You can adjust the resolution with a tool like xrandr
.
To check and set the resolution, run:
xrandr
It will list the available resolutions. You can change the resolution with:
xrandr --output <display_name> --mode <resolution>
Disable Window Scaling in VSCode: If VSCode is scaling incorrectly, try disabling or adjusting the scaling settings.
Open VSCode and add the following to your settings:
File -> Preferences -> Settings
(or press Ctrl+,
).window.zoomLevel
and set it to 0
or any negative number to zoom out.Adjust Window Manager Scaling: Since you're using i3, it could be an issue with the window manager's scaling. You can try tweaking the DPI settings in ~/.Xresources
.
Add or modify the following line:
Xft.dpi: 96
Then apply the changes with:
xrdb -merge ~/.Xresources
Force Scaling in GTK: If the file picker is a GTK-based application, you might need to adjust its scaling settings.
You can try setting the GDK_SCALE
and GDK_DPI_SCALE
environment variables. For example:
export GDK_SCALE=1
export GDK_DPI_SCALE=1
For your high-resolution OLED screen, adjusting DPI for better scaling can improve the experience further. Here are a few steps to fine-tune it:
Experiment with DPI Values: You can adjust Xft.dpi
to a higher or more precise value depending on your display resolution. For a high-resolution OLED screen, try values between 120 and 192 for better scaling.
Example:
Xft.dpi: 144
Then reload the settings with:
xrdb -merge ~/.Xresources
Font Scaling for HiDPI: In addition to adjusting Xft.dpi
, you can fine-tune your font sizes for better readability:
~/.Xresources
file, add:Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xft.lcdfilter: lcddefault
GTK and QT Scaling: For better integration of both GTK and QT applications, you can set scaling factors for each:
~/.config/gtk-3.0/settings.ini
:[Settings]
gtk-font-name=Sans 11
gtk-dpi=144
gtk-xft-dpi=144000
QT_SCALE_FACTOR
and QT_FONT_DPI
:export QT_SCALE_FACTOR=1.5
export QT_FONT_DPI=144
Window Manager Specific Tweaks: Since you're using i3, you can also adjust the gaps
and window sizes to better fit the screen real estate:
~/.config/i3/config
), try setting the following:gaps inner 10
gaps outer 10
This will help keep windows well-spaced, making the interface more usable.With these adjustments, your display experience should improve on your high-resolution OLED screen.
To reload changes made in the ~/.config/gtk-3.0/settings.ini
file, you typically need to restart the applications that use GTK, as they read this file during startup. However, there are a few ways to refresh the GTK settings without fully logging out or restarting the system:
Restart the Affected Applications: After modifying settings.ini
, simply close and reopen any GTK-based applications (like file browsers or terminal emulators).
Reload the Session: You can log out and log back into your session. This ensures that the GTK settings are applied across all applications.
Use gnome-settings-daemon
or xsettingsd
:
gnome-settings-daemon
, you can restart this daemon to reload the GTK settings:gnome-settings-daemon --replace &
xsettingsd
, a small X settings daemon, which listens for changes to the GTK settings:killall xsettingsd
xsettingsd &
Restart i3 Window Manager: If you're using i3, restarting i3 can also apply some changes:
Mod + Shift + R
to restart the i3 window manager without logging out.These steps should apply your GTK configuration changes without a full system reboot.
url="https://www.youtube.com/watch?v=kEfldEpDMQA"
chunk_stream() {
# youtube-dl --list-formats $1
local manifest=$(youtube-dl -f 95 -g $1)
echo $manifest
ffmpeg -i $manifest -c copy utube.mp4
# ffmpeg -i $manifest -c copy -f segment -segment_time 10 output-part%d.mp4
# ffmpeg -i 'https://....m3u8' -c copy -f segment -segment_time 1800 output-part%d.mp4
}
chunk_stream $url