• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • The forum software that supports hummy.tv has been upgraded to XenForo 2.0!

    This is a major upgrade which changes the look and feel of the forum somewhat but brings a host of improvements too. Please bear with us as we continue to tweak things and report any issues or suggestions in Site/Forum Issues.

[youtube-dl] Download videos from youtube.com or other video platforms

OP
OP
prpr

prpr

Well-Known Member
#81
IIRC swapper is a prpr product.
It was originally, but there was some unpleasantness surrounding it.

Permanent fix:
Code:
--- /mod/etc/init.d/S00swapper~
+++ /mod/etc/init.d/S00swapper
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-[ "`cat /etc/model`" = "HDR" ] || exit 0
-
 swapfile=/mnt/hd3/.swap0
+[ "`cat /etc/model`" = "HD" ] && swapfile=/media/drive1/.swap0
 
 case "$1" in
     start)
 
OP
OP
prpr

prpr

Well-Known Member
#83
Does it need to be got rid of once set up?
Just included for completeness, in case.
Here's my complete version of/mod/etc/init.d/S00swapper (it has better error checking than af123's):
Code:
#!/bin/sh

swapsize=128
swapfile=/mnt/hd3/.swap0
[ "`cat /etc/model`" = "HD" ] && swapfile=/media/drive1/.swap0

case "$1" in
        start)
                grep $swapfile </proc/swaps >/dev/null
                if [ $? -ne 0 ] ; then
                  dd if=/dev/zero of=$swapfile bs=1M count=$swapsize
                  mkswap $swapfile
                  swapon $swapfile
                  echo "Enabled swap file."
                fi
                ;;
        stop)
                grep $swapfile </proc/swaps >/dev/null
                if [ $? -eq 0 ] ; then
                  swapoff $swapfile
                  echo "Disabled swap file."
                fi
                [ -f $swapfile ] && rm $swapfile
                ;;
        *)
                exit 1
                ;;
esac

exit 0
 

Black Hole

May contain traces of nut
#84
Can't guarantee the syntax or the correctness of my assumptions, but what about?:

Code:
#!/bin/sh

swapsize=128
swapfile=/mnt/hd3/.swap0
[ "`cat /etc/model`" = "HD" ] && swapfile=/media/drive1/.swap0

case "$1" in
        start)
                grep $swapfile </proc/swaps >/dev/null
                if [ $? -ne 0 ] ; then
                  dd if=/dev/zero of=$swapfile bs=1M count=$swapsize
                  mkswap $swapfile
                  swapon $swapfile
                  echo "Enabled swap file."
>>>             ELSE ECHO "Swap file already running"
                fi
                ;;
        stop)
                grep $swapfile </proc/swaps >/dev/null
                if [ $? -eq 0 ] ; then
                  swapoff $swapfile
                  echo "Disabled swap file."
>>>             ELSE ECHO "Swap file not running"
                fi
                [ -f $swapfile ] && rm $swapfile
                ;;
        *)
                exit 1
                ;;
esac

exit 0
 

af123

Administrator
Staff member
#85
Looks like I should update it to support the HD then (assuming writable disk attached - 128MiB is not going to inconvenience anyone)
 

MontysEvilTwin

Well-Known Member
#87
Thanks @prpr, @Black Hole and @af123. I will turn on the swap file and see if my Youtube-dl downloads work. One more thing, does sysmon log the CPU usage on the HD-FOX? It does seem to monitor network traffic but not CPU. Unless my installation is a bit broken, of course.
 

MontysEvilTwin

Well-Known Member
#88
To update, the YouTube-dl downloads are working fine with the swap file enabled. This includes repeat downloads which either crashed or locked-up the unit before. Thanks for the help.