Often, I need to do something that I have done many times in the past but I have forgotten how to do it. This is a page to complement my clone at parsiya.io and give me a simple repository of how-tos I can access online.
In this page you may find those commands and tips that I need from time to time
(and usually forget when I need them). Look at the table of contents
below or ctrl+f
and search for keywords.
Insert XKCD 1168, hur dur!
tar -zcvf target_tar.tar.gz directory_to_be_compressed
tar -zxvf target_tar.tar.gz path/to/decompress/
echo | openssl s_client -connect HOST:PORT 2>/dev/null | openssl x509 -text -noout
openssl s_client -connect HOST:PORT -cipher cipher-name -brief
-brief
: reduced outputcipher-name
: A cipher from output of openssl ciphers
commandI have switched to s3deploy from s3cmd. https://github.com/bep/s3deploy.
Create a file named .s3deploy.yaml
(not the period) in the root of website. I
use this:
routes:
- route: "^.+\\.(js|css|svg|ttf|eot|woff|woff2)$"
# cache static assets for 20 years
headers:
Cache-Control: "max-age=630720000, no-transform, public"
gzip: true
- route: "^.+\\.(png|jpg)$"
headers:
Cache-Control: "max-age=630720000, no-transform, public"
gzip: true
- route: "^.+\\.(html|xml|json|js)$"
gzip: true
The file should be self-explanatory. Don't set gzip
for txt
files,
it will break your keybase proof.
Then run (change the region if needed):
s3deploy.exe -source=public/ -region=us-east-1 -bucket=[bucketname]
To pass your AWS key and secret, you can either set them in an environment variable or in this file:
c:\Users\[your user]\.aws\credentials
Like this:
[default]
aws_access_key_id=
aws_secret_access_key=
These might be updated because I do not use s3cmd anymore.
python s3cmd sync --acl-public --delete-removed --rr directory-to-sync/ s3://bucket-name
E.g., uploading the Hugo public directory to my website:python s3cmd sync --acl-public --delete-removed --rr public/ s3://parsiya.net
--acl-public
: Anyone can only read.--delete-removed
: Delete objects with no corresponding local files.python s3cmd --acl-public --no-preserve --mime-type="text/css" put public/css/hugo-octopress.css s3://parsiya.net/css/hugo-octopress.css
|
|
When setting up a static website in an S3 bucket, you need to specify an index
and an error page. The index cannot be in a sub-directory but the error page
can. Set the index to a non-existent file (e.g. whatever.crap
) and set the
error page to the actual index page. The browser will be redirected to the error
page:
If you are relying on error pages, this will mess with your site because every error will be redirected to the index. Another way is to set a meta redirect in the index file in the root directory and redirect to that page.
Use --no-sign-request
. E.g., to list all items in a world-readable bucket:
aws s3 ls s3://bucket-name --no-sign-request --recursive
control inetcpl.cpl,,4
where.exe
searches for files. If no location is passed it searches in the
local directory and then in PATH.
/R
searches recursively in a specific location./T
displays file size./?
for help.mkdir empty_dir
robocopy empty_dir the_dir_to_delete /s /mir
rmdir empty_dir
rmdir the_dir_to_delete
lxrun /install
does not work anymore.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Ubuntu
in Windows store and install Ubuntu.Ubuntu
in the start menu and run it.bash
in a command prompt to start it.Main instructions:
home
.ssh-keygen -t rsa -b 4096 -C "[email protected]"
ssh-agent
installed in WSL. It should be installed out
of the box.Add the following lines to ~/.bashrc
to start ssh-agent
and add your key
every time you run bash
.
env=~/.ssh/agent.env
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ; }
agent_load_env
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
agent_start
ssh-add
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then
ssh-add
fi
unset env
# adding the github key to ssh-agent
# change if the private key file changes
ssh-add ~/.ssh/id_rsa
Add the SSH key to github/gitlab.
Navigate to your git folder in a normal command prompt and run bash
and use
git normally.
???
Profit
TL;DR: exit status 3221225781
on Windows means a DLL is missing. In this
case, diff.exe
was missing libintl3.dll
and it made gorename
stop working.
Get and install it from:
The Actual Problem:gorename
stopped working and I got the following error in the VS Code console:
Rename failed: gorename: computing diff: exit status 3221225781 gorename:
computing diff: exit status 3221225781 gorename: failed to rewrite 2 files
Searching for 3221225781
sent me to
Rust language issue 42744
which means a DLL is missing. Run where diff
to find out where it is and it
was in \Go\bin\diff.exe
. Running diff.exe
manually got this prompt.
The code execution cannot proceed because libintl3.dll was not found.
Reinstalling the program may fix this problem.
Go to http://gnuwin32.sourceforge.net/packages.html and click on Setup
in
front of DiffUtils
. It will download a package which contains the utils and
two DLLs: libintl3.dll
and libiconv2.dll
. Copy all of them to where the
original diff.exe
was and it should work.
This is useful when you want to refer to a specific directory as a drive.
subst X: C:\path\to\source\code
There are two issues:
We could use net use
as follows but it does not show up in Docker's
settings > Shared Drives
either.
net use W: \\localhost\$c\path\to\source\code
To share a drive, create a VHD mount and share it instead.
Use these instructions to create a VHD and mount it:
Use these instructions to automount it at startup:
After locking the computer the monitor might go to sleep. To disable:
Open the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\
7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7
Look at the value Attributes
and change it from 0x00000001
to 0x00000002
.
Open the Control Panel (control.exe) and go to Power Options
.
Click Change plan settings
in front of the selected power plan.
Click Change advanced power settings
.
Now under Display
there should be a new item: Console lock display off timeout
.
Change this to whatever you want.
plutil -convert xmlfile.xml com.apple.springboard.plist
where:
plutil
is installed with iTunes.plutil
is in C:\Program Files\Common Files\Apple\Apple Application Support
.
Source: https://superuser.com/a/1264369
wmic service get displayname,pathname|findstr /IV "C:\Windows"|findstr /IV """
Unquoted service paths are usually not exploitable. See No, You Are Not Getting a CVE for That.
The new Edge uses Chromium. Chromium uses the WinINET proxy settings. Instead of redirecting everything to the browser, we can set the proxy using the command line (all of these also work for Chrome and every other browser built on Chromium):
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --proxy-server="http://localhost:8080"
The following does the same but falls back to direct connect if the proxy is not available. Don't use this because you will not know if the fall back happens:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --proxy-server="http://localhost:8080,direct://"
You might have enabled the privacy settings in Windows 10.
Microphone privacy settings
.Win32WebViewHost
.They can be extracted using the built-in msiexec
tool.
msiexec /a c:\path\to\file.msi /qb TARGETDIR=C:\absolute\path\to\extract\directory
/
as path separator.Could not access network location 'xxx'
.If the "Microsoft Lifecam Cinema" webcam constantly autofocuses on Windows 10.
You can also try in Skype which is where the old utility is accessible.
Debugging Tools for Windows
.C:\Program Files (x86)\Windows Kits\10\Debuggers\
windbg -I
Delete some registry keys.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
.Debugger
key.HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug
.Debugger
key.This happens in two instances:
Record display filter in capture file
when saving the
file in Netmon.If you already have a file with the display filter you can remove it.
netmon_filter
in Wireshark. You will most likely see one packet.
It's the first packet and its ID is 1.editcap
to remove it.C:\Program Files\Wireshark>editcap -F netmon2 C:\path\to\netmon.cap C:\path\to\modified.cap 1
modified.cap
in Wireshark and save it as pcap.For example, running notepad
as admin.
notepad
, now notepad is selected.Windows+R
and enter notepad
.ctrl+shift+enter
.If you cannot delete firewall rules you can delete their corresponding rule (user added ones are represented by a GUID) in the registry. This also helps if the rule text does not say which executable is targeted:
Location:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules
Format:
To install telnet client
in an admin command prompt:
pkgmgr /iu:"TelnetClient"
Control Panel > Programs > Programs and features
.Installed Updated
.Internet Explorer 11
.Find the task name in the PathToTask
registry key and use it in the command:
$PathToTask = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\[replace with task]"
$SDBin = ( (get-itemProperty $PathToTask).sd )
ConvertFrom-SddlString ([wmiclass]"Win32_SecurityDescriptorHelper").BinarySDToSDDL($SDBin).SDDL
HKEY_LOCAL_USER
is a subset of HKEY_USERS
for the current user. Under
HKEY_USERS
we see a bunch of directories. To figure out the users for these
directories we need to see them in the following location:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\
For example, I have HKEY_USERS\S-1-5-21-2868049494-289672223-1164028246-1001
in a VM. So I go to
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-2868049494-289672223-1164028246-1001
and look under the ProfileImagePath
key to see which user it is.
Get-ChildItem "searchterm" -recurse -force -path c:\ | select-object FullName
-recurse
: recursive. Loops through all directories-force
: list hidden files.select-object
: Selects each file from last pointFullName
: Only display file nameCompare-Object (Get-Content new1.txt) (Get-Content new2.txt) | Format-List >> Diff-Output
Output will be in format of
InputObject
: c:\users\username\somefile
-- line contentSideIndicator
: =>
-- exists in new2.txt (second file, file to the right)Or just use [ripgrep][ripgre-link] like rg -i 'whatever'
.
findstr "something" *.txt
will include filename and line (no number AFAIK).
findstr /spin /c:"keyword" *.*
If you want to search for different keywords (with OR) remove the /c:
findstr /spin "keyword1 keyword2" *.*
will search for keyword1 OR keyword2 in files
whatever.exe | Select-String -pattern "admin"
Get-Acl -path c:\windows\whatever.exe | Format-List
icacls.exe c:\windows\whatever.exe
Measure-Command {python whatever.py}
You clicked on a VHD file and now cannot delete it. Use this PowerShell command. The path to VHD should be absolute.
Dismount-DiskImage -ImagePath 'C:\full\path\to\whatever.vhd'
Use certutil
for bootleg base64 encoding/decoding:
certutil -encode whatever.exe whatever.base64
certutil -decode whetever.base64 whatever.exe
Compress-Archive -Path C:\path\to\folder\ -DestinationPath c:\path\to\destination\archive
Note the destination file will be archive.zip
but we do not need to
provide the extension in the command.
Switching from VirtualBox for Hyper-V had its own set of tradeoffs.
When creating a Virtual Switch in Hyper-V you get an error along the lines of "failed adding ports to the switch" and "a parameter passed was invalid."
netcfg -d
.You cannot clone VMs in Hyper-V like VirtualBox. Create a copy of the vhd(x) hard disk and use it in a new VM. Yes, it's as manual as it sounds.
The internet recommends creating an external virtual switch but it did not work for me. I deleted the external switch and used the default switch and it somehow worked so try doing that.
This might also happen if you are using an active VPN connection by
Cisco AnyConnect
on the host.
Seems like the highest resolution is 1080p.
sudo nano /etc/default/grub
.GRUB_CMDLINE_LINUX_DEFAULT
toGRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080"
sudo update-grub
.Most important item, do not select log in automatically
during setup.
Otherwise, xRDP will fail silently.
In a default Hyper-V guest networking setup the local DNS resolver cache is empty.
ipconfig /displaydns
prints nothing.8.8.8.8
or 1.1.1.1
.Sometimes disabling and enables clipboard in VirtualBox menu works.
Assuming you have a Windows guest. Inside the Windows guest do:
VBoxTray.exe
in task manager.VBoxTray.exe
again.You cloned a Windows VirtualBox VM and now you have to activate it again. This script changes the hardware UUID of the cloned machine to the old one. No reactivation needed.
$ORIGVirtualMachineName="Windows 10 - Base" # Old VM name as it appears in VirtualBox
$clonedVirtualMachineName="Win10Clone" # New VM name
$vboxDir="c:\Program Files\Oracle\VirtualBox" # Directory containing VBoxManage
cd $vboxDir
$uid=$($($(.\VBoxManage.exe showvminfo $ORIGVirtualMachineName|select-string "Hardware UUID:").ToString()).Split())[4]
.\VBoxManage modifyvm $clonedVirtualMachineName --hardwareuuid $uid
The default modern.ie VMs come with a 40GB vmdk hard drive and I want to resize them to 100GB (because videogames are big). VirtualBox cannot resize it. We can clone it to vdi, resize it and convert it back to vdmk.
VBoxManage
is at c:\Program Files\Oracle\VirtualBox
(default installation).
VBoxManage clonemedium "MSEdge - Win10.vmdk" "MSEdge - Win10.vdi" --format vdi
VBoxManage modifymedium "MSEdge - Win10.vdi" --resize 102400
VBoxManage clonemedium "MSEdge - Win10.vdi" "MSEdge - Win10-resized.vdi" --format vmdk
Disk Management
(Windows).diskmgmt.msc
.Extend
.I know a total of 5-6 git commands and that is fine.
This works with small branches (e.g. one fix or so). Adapted from a Bitbucket tutorial.
Create new branch and checkout - git checkout -b fix-whatever
This will create a branch of whatever branch you are currently on so make sure you are creating a branch from the branch you want. This is the same as git branch whatever
and git checkout whatever
.
Make changes and commit - git add - git commit
Make any changes you want to do, then stage and commit.
Push the branch to remote repo [optional] - git push
This can be safely done because it's an obscure branch and no one else cares about it.
Go back to the original branch to merge - git checkout master
Master or whatever branch you were at step one.
Merge the branches - git merge fix-whatever
.
Alternatively squash all commits into one git merge --squash fix-whatever
and then git commit -m "One message for all commits in merge"
.
Delete branch - git branch -d fix-whatever
We don't need it anymore. If it was pushed to remote, then we need to delete it there too.
git clone -b <branch> <remote_repo>
Because this keeps happening to me.
Reset the head in local repo N commits back. - git reset HEAD~N
Where N is the number of commits that you want to revert.
Make changes and stage them - git add
Commit the changes - git commit
Force push the local repo to remote - git push -f
Note this will force the update and erase the commit history online. If not one else is using the repo in between it's ok.
Let's say you have forked a repository. Now, you want to sync the changes.
upstream
.git remote add upstream [email protected]:original-user/original-repo.git
git remote add upstream https://github.com/original-user/original-repo/
git remote -v1
git fetch upstream
upstream/main
branch into the local main
branch:git merge upstream/main
Create a file called npp
with the following content and copy it to
cygwin\bin
. Modify the path of notepad++ to point to your installation.
'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin "$(cygpath -w "$*")"
Run the following command in Cygwin to set it as global git editor:
git config --global core.editor npp
A.K.A. when moving repository
from bitbucket to github or vice versa.
git remote set-url origin [email protected]:parsiya/repository.git
I wanted to see if I was still showing up as root
.
git shortlog -s | cut -c8-
parsiya.net
had commits as root
from when I was using it offline. I wanted
to change everything to myself.
git rebase -i --root
git rebase -i AAAA
pick
to edit
for every commit with the old author and save. Rebase starts and pauses at every commit with edit
.git commit --amend --author="Author Name <[email protected]>"
git rebase --continue
You have added files with git add
but have not committed them and want to
remove some (not all) instead of git reset
.
git reset HEAD -- file/directory
In a case-insensitive file system (Windows, Mac), git is case-insensitive by
default. So if you rename Bob.jpg
to bob.jpg
after it has already been
pushed, git doesn't change it because from a file-system perspective it's the
same file (although Windows shows the filename in lowercase).
To make git sensitive on a case-insensitive file system (Windows, OSX) we can do:
git config core.ignorecase false
However, this introduces its own problems. Let's assume you have already
committed Bob.jpg
and make git be case-sensitive. Now you rename it to
bob.jpg
and commit and push it. In the remote repo you will have two files
Bob.jpg
and bob.jpg
.
The answer is to rename Bob.jpg
to something else like Bob-1.jpg
, push and
then rename it back to bob.jpg
.
.gitignore
only works on new git add
s. If we have already added
blah/whatever.cpp
to the repo, adding whatever.cpp
to .gitignore
does
nothing.
Do this first and then gitignore
will work (not using --cached
will remove
the file completely from the filesystem):
git rm --cached blah/whatever.cpp
Use -r
for recursive change. Needed for directories.
Note: Also overwrite history if the file had secrets/sensitive info.
Follow this guide:
My current (as of June 2019) editor of choice. Settings are at https://parsiya.io/categories/configs/vscode/.
This allows us to have specific language highlighting for custom extensions. Add
the following to settings.json
:
"files.associations": {
"*.whatever": "cpp",
"*.generics": "go"
}
This is specially useful if you want to keep an older version of an extension because it disables auto-update for that extension.
Install Another Version...
.VS Code needs to open a workspace. Open the parent directory to the project.
Source: https://www.reddit.com/r/golang/comments/g6l6y9/couldnt_start_client_gopls_unsupported_uri_scheme/
Tips for using the Sublime Text 3 editor. I don't use Sublime Text anymore although I bought it so this section is probably outdated.
GoSublime's executable has Go version in it. In most cases, it cannot grab the version on Windows and the build will fail like this:
MarGo: MarGo build failed
cmd: `['C:\\Go\\bin\\go.exe', 'build', '-tags', '', '-v', '-o',
'gosublime.margo_r17.12.17-1_go?.exe', 'gosublime/cmd/margo']`
Where ?
is the Go version that is unknown.
Edit this file:
%AppData%\Sublime Text 3\Packages\GoSublime\gosubl\sh.py
Find these lines:
cmd = ShellCommand('go run sh-bootstrap.go')
cmd.wd = gs.dist_path('gosubl')
cr = cmd.run()
raw_ver = ''
ver = '' # Change this to '1'
Edit ver
to whatever, I usually do 1
. Restart Sublime Text and Margo will
build.
This must to be done for every new GoSublime version.
File > New view into File
. Then drag the pane to a second screen/location.
This might happen inside Virtual Box.
You have two options:
Run Burp with 3D disabled (make a shortcut): \
java.exe "-Dsun.java2d.d3d=false" -jar burp.jar
The complete command for the default install on Windows is:
"C:\Program Files\BurpSuiteCommunity\jre\bin\java.exe"
"-Dsun.java2d.d3d=false"
-jar "C:\Program Files\BurpSuiteCommunity\burpsuite_community.jar"
Source - credit to floyd
:
Technically this works with any proxy but I use Burp.
Let's assume we want to redirect all traffic to 443
and 80
to Burp's
listener at 192.168.137.1:8080
. This is the default IP address of a Windows
machine if the mobile hotsport network is enabled:
iptables -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to-destination 192.168.137.1:8080
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.137.1:8080
iptables -t nat -A POSTROUTING -p tcp --dport 80 -j MASQUERADE
iptables -t nat -A POSTROUTING -p tcp --dport 443 -j MASQUERADE
Not the best regex but does the job:
http([^"])*\.([^"])+
Better but more expensive regex:
/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)
(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*
(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])
I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.
They are installed in ~/.local/bin
. Add it to your $PATH
.
su -
: If you do su
alone, you might not find usermod
in your path.usermod -aG sudo user-name
docker images
docker rmi img1 img2
docker rmi whatever/blah
docker rmi f20d
docker build . -f file -t whatever/blah
DockerFile
it does not need to be mentioned. docker build -t whatever/blah
docker image
should display the image now.docker container ls -a
- docker ps -a
docker ps
docker stop d194 3f4a
docker ps -a -q | ForEach { docker stop $_ }
docker stop $(docker ps -a -q)
docker container rm d194 3f4a
docker run -it whatever/blah [command]
where command is usually /bin/bash
.--rm
to delete the container after it exits. This is useful when testing.DockerFile
: CMD ["/usr/sbin/init"]
docker run -it whatever/blah sh
Restart...
.These were written when I used Python 2, some might not work with newer versions.
from itertools import product
if __name__ == "__main__":
set1 = ["https://example.net", "https://google.com"]
set2 = ["/whatever", "/something"]
for e1, e2 in product(set1, set2):
print(e1+e2)
Note the space on second line.
string1 = "This is line one of the string that is going to be over 80"
" characters and thus needs to be broken into two or more lines."
Because I always forget.
def main():
# whatever
if __name__ == "__main__":
main()
"{}*{} = {}".format(x, y, x*y)
With Python 3, it's not that useful but still:
import itertools
def xor_byte(payload, key):
"""
Get a bytearray, XOR it with a key (bytearray) and repeat the key
Return bytearray
"""
return bytearray((mybyte ^ keybyte) for (mybyte, keybyte) in
itertools.izip(payload, itertools.cycle(key)))
Same as above but string
import itertools
def xor_str(payload, key):
"""
Get a string, XOR it with a key (string) and repeat the key
Return string
"""
return "".join(chr(ord(mybyte) ^ ord(keybyte)) for (mybyte, keybyte) in
itertools.izip(payload, itertools.cycle(key)))
You can run Python one-liners from command line using python-c "command"
.
Commands inside needs to be separated using ;
and use '
inside. Remember
that you need to import
things too.
For example a one-liner to encode something in base64:
python -c "from base64 import b64encode; print b64encode('HelloHello');"
More:
# Decrypt from AES (you need pyCrypto)
python -c "from Crypto.Cipher import AES; aes = AES.new(KEY, AES.MODE_ECB); print aes.decrypt(CIPHERTEXT));"
This usually happens when I am testing a Java app and it uses log4j
but
logging is not enabled.
Create a file named log4j.properties
by the main jar file and put the
following in it. Add -Dlog4j.debug
to the app's command line parameters.
The app might already have the command to log but is just missing the file. Use
procmon
to see which paths are searched to find this gile. Result is NAME NOT FOUND
is your friend.
log4j.rootLogger=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
I love Wuxia (Chinese martial arts if I am not mistaken) series and movies. The
following youtube-dl command will
download the 56 episode HQ quality Chinese TV series called Xiao Ao Jiang Hu
or Laughing in the Wind
(also called The Smiling Proud Wanderer
or
Swordsman
).
youtube-dl --ignore-errors --write-srt --sub-lang en --yes-playlist 'https://www.youtube.com/playlist?list=PLuGy72vdo4_ScwTYb1bAynhBs3KgowvvQ'
--ignore-errors: continue after errors
--write-srt : download substitles
--sub-lang : subtitle language (in this case English)
--yes-playlist : link to a Youtube playlist
Youtube-dl
can be downloaded using pip
. For example on Windows:python -m pip install youtube-dl
.
It's also possible to download binaries from https://github.com/ytdl-org/youtube-dl/releases.
Sometimes, you need to pass --no-check-certificate
to bypass certificate
errors.
I gave away the printer when I moved to Canada but I am keeping the instructions just in case. Before printing, get to printer physically and use the following instructions:
Please Wait
and grabs the paper.Now open LibreOffice and use these instructions:
Insert > Envelope
.Addressee
.Sender
and enter your own address in the bottom textbox.Printer
tab.Setup
.Properties
.Com-10
.Envelopes
.Manual
.Add ?ts=4
to end of the file URL.
To split a file with ffmpeg
. Let's say we want to grab the first 200 seconds
of a file starting from second 100.
ffmpeg -i input.mp4 -strict -2 -ss 100 -t 200 output.mp4
I also use it to reduce the file size of my video proof-of-concepts:
video.mkv
.File (menu) > Remux Recordings
to get
video.mp4
.ffmpeg
to reduce the file size:ffmpeg -strict -2 -ss 0 video-processed.mp4 -i video.mp4
.I still need to experiment with different codecs to figure out which one is better but this method reduces the file size dramatically without a noticeable change in quality.
Easier method: In the View Source
page, right-click and select Wrap Long Lines
.
about:config
view_source.wrap_long_lines
to true
.