Skip to content

Instantly share code, notes, and snippets.

Silviu Vulcan silviuvulcan

Block or report user

Report or block silviuvulcan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@silviuvulcan
silviuvulcan / youtube-list.sh
Created Aug 18, 2014
download list of youtube urls
View youtube-list.sh
#!/bin/bash
if [ ! -f $1 ]; then
echo "I need url list"
exit 1
fi
cat $1 | while read url; do
youtube-dl -c --write-description --max-quality H264 -c $url
done
@silviuvulcan
silviuvulcan / magnet.sh
Last active May 31, 2018
Add torrents to remote transmission machine (from firefox)
View magnet.sh
#!/bin/bash
REMOTE='user@1.2.3.4'
ssh $REMOTE "/usr/bin/transmission-remote --add \"$1\""
@silviuvulcan
silviuvulcan / restart.sh
Created Aug 19, 2014
restart remote service if it's running (postfix, apache)
View restart.sh
# postfix
tentakel -g group 'if pgrep master >/dev/null ; then echo RESTART; /etc/init.d/postfix restart; fi'
# httpd
for srv in $(cat server.list); do echo -en "$srv \t- "; ssh $srv "httpd -k restart" ; done
@silviuvulcan
silviuvulcan / gist:e9d5838a81f5ba8de850
Created Aug 19, 2014
convert pdf to greyscale on the command line
View gist:e9d5838a81f5ba8de850
gs \
-sOutputFile=output.pdf \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray \
-dCompatibilityLevel=1.4 \
-dNOPAUSE \
-dBATCH \
input.pdf
@silviuvulcan
silviuvulcan / n800.sh
Created Aug 19, 2014
Nokia N800 mplayer settings
View n800.sh
mplayer -lavdopts lowres=1 <videofile>
mplayer quiet-file -af volume=10
View n800-clone.sh
In short, this is what I did to get my N800 to boot OS2008 from MMC. My steps were:
1) upgraded my N800 to OS2008, http://europe.nokia.com/A4305010
2) enabled the Maemo Extras repository in Application Manager and added http://repository.maemo.org, Distribution: (blank) Components: free non-free
3) installed openssh using Application Manager
4) defined a root password (openssh's installer prompted for this)
5) opened xterm and:
# ssh root@localhost
# visudo
@silviuvulcan
silviuvulcan / screen-items.sh
Created Aug 19, 2014
script screen to create multiple windows
View screen-items.sh
#!/bin/bash
screen -dmS servers -T xterm -t "http" sh -c 'cd /servers/start/httpo;run.sh'
screen -T xterm -S "servers" -X screen screen -t "sql" sh -c 'cd /servers/start/sql;run.sh'
# The "-T xterm" switch isn't really necessary, unless you plan to use curses-based programs from inside the screen (mc, less, etc.).
View debian-networking-dom0-xen-wheezy.md
@silviuvulcan
silviuvulcan / convert.sh
Last active Aug 29, 2015
Convert pfx certificate for apache usage
View convert.sh
openssl pkcs12 -in example.com.pfx -clcerts -nokeys -out example.com.crt
openssl pkcs12 -in example.com.pfx -nocerts -nodes -out example.com-encrypted.key
openssl rsa -in example.com-encrypted.key -out example.com.key
openssl pkcs12 -in example.com.pfx -nodes -nokeys -cacerts -out example.com.ca
View screen-statusbar
hardstatus alwayslastline
# hostname / time /date / load / screens
#hardstatus string "%{b kw}%H %{r}%1` %{w}| %{g}%c %{w}| %{y}%d.%m.%Y %{w}| %{g}%l %{w}| %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<"
# hostname screens load date time
#hardstatus string '%{= kw}[ %{= kb}%H%{= kw} ][%= %{= kw}%?%-Lw%?%{= kW}%n*%f %t%?%?%{= kw}%?%+Lw%?%?%= ][ %{r}%l%{w} ]%{w}[%{r} %d/%m/%y %C %A %{w}]%{w}'
# combination of the above (with the nicer screen list)
hardstatus string '%{= kw}[ %{= kb}%H%{= kw} ][ %= %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw %= ][ %{r}%l%{w} ]%{w}[%{r} %d/%m/%y %C %A %{w}]%{w}'
You can’t perform that action at this time.