openssl passwd -apr1
Enter password you want twice when prompted, it will generate an apr1 encrypted password
Add:
username:$apr1encryptedpassword
vi /etc/nginx/htpasswd
service nginx restart
SCOTR074:$apr1$MlStQ7sB$j0KTSvgtCaNPUeSrkZBas/
openssl passwd -apr1
Enter password you want twice when prompted, it will generate an apr1 encrypted password
Add:
username:$apr1encryptedpassword
vi /etc/nginx/htpasswd
service nginx restart
SCOTR074:$apr1$MlStQ7sB$j0KTSvgtCaNPUeSrkZBas/
Plex doesn't seem to install comskip on linux by default. Although it says it uses it, it's not in the tarball so nothing actually happens. I guess it assumes you've figured it out on your own(?).
Install comskip:
Dependencies:
apt-get install -y autoconf libtool git build-essential libargtable2-dev libavformat-dev libsdl1.2-dev
sudo su -
git clone git://github.com/erikkaashoek/Comskip
cd Comskip
./autogen.sh
./configure
make
make install
Auto-skip *should* work now if you set it up in the DVR settings, existing recordings won't have commercials skipped.
Manual commercial scans (i.e. go fix my existing recordings!):
cd to your recording
comskip --ini=/usr/lib/plexmediaserver/Resources/comskip.ini MyRecording.ts
and wait.
it makes the edl and txt files for Plex to skip commercials, but does not modify the original file in any way
Or, go hit your entire DVR directory recursively:
This helps when you have to chase down stupid stuff all day, every day by highlighting the typical offenders:
Launch iTerm2
Go to iTerm2 - Preferences - Profiles - Advanced - Triggers - Edit
Click +
In the Regex, type: (error|ERROR|Error)
Action: Highlight Text
Pick a color, Pick a background color that stand out for you
Check the Instant box
Close back out
I have:
(Fail|FAIL|fail)
(Differ|DIFFER|differ)
(Insufficient|INSUFFICIENT|insufficient)
(Access|ACCESS|access)
(Denied|DENIED|denied)
(Error|ERROR|error)
Sorting out connection resets:
tcpdump -nn -v 'tcp[tcpflags] & (tcp-rst) != 0'
or
tcpdump -ilo -nn -v 'tcp[tcpflags] & (tcp-rst) != 0'
-n is to stop resolving DNS names
-nn is to stop resolving DNS names AND port numbers to names
This is really useful when an app is logging connection resets, but not telling you what it is trying to connect to in the first place.
Start with list.txt like:
server7858 server7858 server7858 server7858 server7861 server7860 server8310 server8310 server7863 server8311
server7859 server7859 server7859 server7859 server8781 server8676 server8677 server8677 server8679 server8782
Which has duplicates and long lines and crap. Run this:
rm list2.txt
rm list3.txt
for word in `cat list.txt`; do echo $word ; done |sort |uniq >> list2.txt
sed -ibak -e 's/ //g' list2.txt
cat list2.txt |sort|uniq > list3.txt
vi list3.txt
ta da!
if you need word counts and such, pipe it through wc before running uniq
more metadata, this one is hard to find:
bash
list
word
parse
parsing
text
columns
sorting
collapse
words
shell
script
split
line
lines
grep
sudo cp /usr/lib64/libxcb.so.1 /usr/share/code/ libxcb.so.1
cd /usr/share/code/
sudo sed -ibak -e 's/BIG-REQUESTS/_IG-REQUESTS/g' libxcb.so.1
Had the exact same problem with Atom and this worked for that too.
if [[ ${TAG_VALUE}XXX == "XXX" ]]; then
echo "TAG_VALUE was blank, exiting!"
exit
fi
case ${TAG_VALUE} in
1)
echo 'I am the first box'
;;
2)
echo 'I am the second box'
;;
3)
echo 'I am the third box'
;;
4)
echo 'I am the fourth box'
;;
5)
echo 'I am the fifth box'
;;
*)
echo 'I am another box higher than 5'
;;
esac
# To read the Name tag:
TAG_NAME="Name"
INSTANCE_ID="`./ec2-metadata -i | cut -f 2 -d " " `"
REGION="`././ec2-metadata -z | cut -f 2 -d " " `"
REGION=${REGION%?}
TAG_VALUE="`aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=$TAG_NAME" --region $REGION --output=text | cut -f5`"
Gives:
set |grep TAG_VALUE
TAG_VALUE='brad test box'
# To see ALL tags to see WTF: (use region from above)
aws ec2 describe-tags --region us-east-1 --output=text
# To read the Created-by custom tag:
TAG_NAME="created-by"
INSTANCE_ID="`./ec2-metadata -i | cut -f 2 -d " " `"
REGION="`././ec2-metadata -z | cut -f 2 -d " " `"
REGION=${REGION%?}
TAG_VALUE="`aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=$TAG_NAME" --region $REGION --output=text | cut -f5`"
set |grep TAG_VALUE
TAG_VALUE=test-kitchen
# To read the nifi-node-num custom tag:
TAG_NAME="nifi-node-num"
echo "TAG_NAME is: " ${TAG_NAME}
INSTANCE_ID="`./ec2-metadata -i | cut -f 2 -d " " `"
echo "INSTANCE_ID is: " ${INSTANCE_ID}
REGION="`././ec2-metadata -z | cut -f 2 -d " " `"
REGION=${REGION%?}
echo "REGION is: " ${REGION}
TAG_VALUE="`aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" "Name=key,Values=$TAG_NAME" --region $REGION --output=text | cut -f5`"
echo "TAG_VALUE is: " ${TAG_VALUE}
# You need the EC2 Metadata binary for the above to work
wget http://s3.amazonaws.com/ec2metadata/ec2-metadata
chmod u+x ec2-metadata
./ec2-metadata --help
## Retrieving EC2 Metadata
wget http://s3.amazonaws.com/ec2metadata/ec2-metadata
chmod u+x ec2-metadata
./ec2-metadata --help
Usage: ec2-metadata
Options:
--all Show all metadata information for this host (also default).
-a/--ami-id The AMI ID used to launch this instance
-l/--ami-launch-index The index of this instance in the reservation (per AMI).
-m/--ami-manifest-path The manifest path of the AMI with which the instance was launched.
-n/--ancestor-ami-ids The AMI IDs of any instances that were rebundled to create this AMI.
-b/--block-device-mapping Defines native device names to use when exposing virtual devices.
-i/--instance-id The ID of this instance
-t/--instance-type The type of instance to launch. For more information, see Instance Types.
-h/--local-hostname The local hostname of the instance.
-o/--local-ipv4 Public IP address if launched with direct addressing; private IP address if launched with public addressing.
-k/--kernel-id The ID of the kernel launched with this instance, if applicable.
-z/--availability-zone The availability zone in which the instance launched. Same as placement
-c/--product-codes Product codes associated with this instance.
-p/--public-hostname The public hostname of the instance.
-v/--public-ipv4 NATted public IP Address
-u/--public-keys Public keys. Only available if supplied at instance launch time
-r/--ramdisk-id The ID of the RAM disk launched with this instance, if applicable.
-e/--reservation-id ID of the reservation.
-s/--security-groups Names of the security groups the instance is launched in. Only available if supplied at instance launch time
-d/--user-data User-supplied data.Only available if supplied at instance launch time.