53 days ago

SquashFS.net

http://www.gnu.org/copyleft/gpl.html

Information on this wiki is Copyright (C) 2007-2017 Richard Nelson unixabg@gmail.com

This information is free; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL file.

HandbrakeCLI

7 months ago

I recently had the need to create a bridge for DVD's to Chromebooks. The tool I elected to use was the HandbrakeCLI. I did just a bit of reading and found all I needed here:

https://trac.handbrake.fr/wiki/CLIGuide

And here is the basic format of what I used for the DVD extraction to a .mp4 file format.

HandBrakeCLI -i /dev/sr0 -o movie.mp4 -e x264 -q 20 -B 160

If you have several DVD's to do the more CPU cores the better. HandbrakeCLI is coded very well and did use all the avaliable CPU cores on my Linux testing system.

Update: I did bump trying to use HandbrakeCLI and I kept getting no title found error. I ended up using the below option:

-t, --title <number>
    Select a title to encode (0 to scan all titles only, default: 1)

with a value of -t 0 and discovered that the actual title I wanted was 2. So then adjusting the above command to this:

HandBrakeCLI -i /dev/sr0 -t 2 -o movie.mp4 -e x264 -q 20 -B 160

worked for me.

Win7 USB from Linux

10 months ago

Although I do not write about Windows operations very often, I had the chance to make a Live Windows 7 USB key from Linux only. I did a lot of reading and there are utilities which help, but I ended up here to find the method that worked for me:

https://thornelabs.net/2013/06/10/create-a-bootable-windows-7-usb-drive-in-linux.html

And instead of ms-sys, I read here https://ubuntuforums.org/showthread.php?t=1009707 and used lilo, which did in fact boot the key fine.

Now I will outline the steps in case something happens to the link above.

1. Zero filled the usb drive for just a bit.

2. Opend the usb drive with:  fdisk /dev/sdX
  2.a. Create a new primary partition table.
  2.b. Press t and Enter (Partition 1 is automatically selected because it’s the only partition). Type 7 and Enter to change the type to HPFS/NTFS/exFAT.
  2.c. Press a to enable the boot flag.
(from here you could press p to display the information)
  2.d. Finally, type w and Enter to write the changes.

3. Open the drive with parted

     parted /dev/sdX

   and below is a list of the commands used to setup the partition as it needs to be:

     (parted) mklabel msdos
     (parted) mkpart primary ntfs 1 -1
     (parted) set 1 boot on
     (parted) quit

4. Format the partition we created to NTFS with the following:

      mkfs.ntfs -f /dev/sdX1

5. The one tutorial wanted to build from source ms-sys, but instead I used lilo from this thread https://ubuntuforums.org/showthread.php?t=1009707

     lilo -M  /dev/sdX mbr

6. Mount the ntfs partition on the usb to say /mnt
7. I used the following to copy the iso file to the usb mount point:

      7z x Win7HomePrem.iso -o/mnt/

8. Unmount lazy /mnt
9. Test boot.

Secure Fill

10 months ago

I had need the other day to do a more secure fill to some block devices and the below is what I found via some searching on the net. Thought I would take a note.

head -c 32 /dev/urandom | openssl enc -rc4 -nosalt -in /dev/zero -pass stdin | dd of=/dev/sdX bs=1M

Package Notes

10 months ago

A few notes for building a package, including uploading to https://mentors.debian.net .

Modify source with version control like git.

Create a debian/changelog:

# One of the two below should work
gbp dch --since=(the commit before you want history) 
git-dch --since=(the commit before you want history)

Tidy up debian/changelog:

vim debian/changelog

Copy source to prestine sid-chroot:

rsync -avC --delete /path/of/source/  /path/to/prestine-sid-chroot/home/user/packageName-version

Make tar file:

tar czf packageName-version.orig.tar.gz --exclude=debian* packageName-version

Attempt to build the package (if errors are encoutered please address):

cd packageName-version && dpkg-buildpackage -us -uc -rfakeroot && cd ../ && lintian -i *.changes

Next sign the built package for upload to mentors.d.n:

debsign your_package.changes 

Next upload with dput:

dput mentors your_package.changes

Here is a copy of my ~/.dput.cf

[mentors]
fqdn = mentors.debian.net
incoming = /upload
method = http
allow_unsigned_uploads = 0
progress_indicator = 2
# Allow uploads for UNRELEASED packages
allowed_distributions = .*

irker

11 months ago

I am new to irker and wanted to do some debugging. So I needed to install:

apt-get install irker

Then I needed to a way to test and debug some things:

irk irc://irc.oftc.net/channel_name "$message"

git notes

12 months ago

Just a few notes here:

# Ask git to fetch info from remote
git fetch <remote>
# Ask git to display the remotes log information
git log FETCH_HEAD

# Link reference for partial cherry pick:
# https://stackoverflow.com/questions/1526044/partly-cherry-picking-a-commit-with-git

git cherry-pick -n <commit> # get your patch, but don't commit (-n = --no-commit)
git reset                   # unstage the changes from the cherry-picked commit
git add -p                  # make all your choices (add the changes you do want)
git commit                  # make the commit!

Blender red sauce recipe

15 months ago

Here is my current Red Sauce recipe:

1. Puree a blender full of cherry or grape tomatoes.

2. In blender add:
 - 3 table spoons of dried parsley
 - 2 table spoons of dried basil
 - 1 table spoon of sea salt
 - 1 table spoon of garlic powder
 - a pinch or two of red pepper

3. In a small sauce pan add:
 - 6 table spoons of olive oil
 - 3 cloves of garlic
 - 3/8 to 1/2 cup of white onion
Simmer the ingredients in the sauce pan until clear and browning.

4. Add sauce pan after cooking to blender and blend.

5. In medium to large sauce pan, bring blended ingredients to a hardy simmer for 25 to 35 min (or till the consistency satisfies you). 
  • If you warm water bath for storage I add 1 table spoon of lemon juice per pint and boil in bath for another 35 minutes.

Ubuntu Remaster Notes

15 months ago

From time to time I need to remaster an Ubuntu based LiveCD. In general I remaster from Debian and with a tool I assisted in writing called live-partial-squashfs-updates that is part of the live-tools package. More information about live-tools is available here: https://packages.qa.debian.org/l/live-tools.html . As a general reference I usually refer to http://customizeubuntu.com/ubuntu-livecd/ but since I am remastering from Debian I thought best to take some notes on the steps to remaster:

Install some tools

apt-get install xorriso squashfs-tools

Mount the ISO

mkdir -p /someTempPath/iso-mount
cd /someTempPath
mount -o loop /pathToLinuxFile/linuxmint-17.1-cinnamon-32bit.iso ./iso-mount

Extract ISO contents

mkdir iso-extract
rsync -av ./iso-mount/ ./iso-extract/

Download the live-partial-squashfs-updates script

cd iso-extract/casper/

# Note that at the time of writing the latest version of the script was not in the debian package of live-tools so I am just downloading from the live-medium-install site.
wget http://install.fyeox.com/scripts/live-partial-squashfs-updates

Create the PSU

# Toggle the execution bit on the script we downloaded
chmod +x ./live-partial-squashfs-updates

# Launch and begin a chroot to make the modifications you want.
# Remember to consider cleaning after your session:
# - apt-get clean
# - apt-get autoremove
# - history -c

./live-partial-squashfs-updates

Now upon saving your changes you can re-run the script to remaster all the psu.squashfs files with filesystem.squashfs in to a new master filesystem.squashfs.

Regenerate the manifest

./live-partial-squashfs-updates   # Run chroot

dpkg-query -W --showformat='${Package} ${Version}\n' > /filesystem.manifest

# Now in a second terminal in the same working folder
cp psu_overlay_rw/filesystem.manifest ./

sed -i '/ubiquity/d' filesystem.manifest

Calculate MD5SUM

#Move up from casper to iso-exports dir
cd ../
find -type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat | sudo tee MD5SUMS

Generate the ISO

xorriso -as mkisofs -r -D -V "Custom LinuxMint" -cache-inodes -J -l -isohybrid-mbr  /usr/lib/ISOLINUX/isohdpfx.bin -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../linuxmint-custom.iso .

_Other Notes_

Note:

I added -isohybrid-mbr  /usr/lib/ISOLINUX/isohdpfx.bin to enable the ISO to be utilized on a usb key as well.

Note:

If booting multiple folders of casper you need to utilize the following boot params:
ignore_uuid live-media-path=/casper2path/

Ubuntu remaster initrd

15 months ago

I had need to test out some casper things and I followed the information at https://wiki.ubuntu.com/CustomizeLiveInitrd

Below is a core exert just in case:

Modify the initrd

1. Extract the contents of the initrd:

mkdir initrd-tmp
cd initrd-tmp
gzip -dc /mnt/casper/initrd.gz | cpio -id

or for Ubuntu 9.10 and later:

lzma -dc -S .lz /mnt/casper/initrd.lz | cpio -id

2. Modify the files

3. Repack them into a new initrd:

find . | cpio --quiet --dereference -o -H newc | gzip -9 > ~/new-initrd.gz

or, if you want an initrd.lz (for Ubuntu 9.10 and later):

find . | cpio --quiet --dereference -o -H newc | lzma -7 > ~/new-initrd.lz

You can now remaster a cd with this new initrd.gz replacing the old /casper/initrd.gz.

However, it is easier to put the initrd on one of your drives, and let a bootloader find it. The bootloader used by the Desktop/live cd, isolinux, is not able to look anywhere else than on the cd it is started from, so we will therefore use another boot loader, grub.

LinuxMint Webpage Not Loading

16 months ago

Recently I had setup a new LinuxMint on a Dell 990 SFF and some web pages did not load in Firefox. So I just assumed maybe some browser related issue and installed Chrome. To my surprise the same pages still would not load. So I upgraded the BIOS and still same results. In the end after some reading online I found this thread:

https://forums.linuxmint.com/viewtopic.php?f=150&t=148462&sid=6c7ded4d7c4d6f1916d9229e3cba7e84&start=20

And in the last post (at the time of writing this note) poster says to try adjusting the network interface MTU setting:

Set the MTU of the interface (eth0 or wlan0) to 1392 if you are on DSL.

Unplug / replug / disconnect/ connect or just reboot after change.

In fact the site was on DSL and after setting MTU on eth0 to 1392, viola!

Motorola Electrify M XT901

16 months ago

The information in this tiddler are notes for me and not for general consumption. Do not use.

Notes for only me begin: Well I had need to move my Motorola XT901 to later version of Android. I needed to get to 4.4.x and the OTA updates just failed. I had rooted the phone and suspected something related to that. The phone is fairly old but works great. Below are some notes. I was moving from a JellyBean boot loader so I installed this image:

https://download.cyanogenmod.org/?device=moto_msm8960_jbbl

Upon install I had to edit the /system/build.prop file and change

From:   ro.telephony.default_network=10
To:     ro.telephony.default_network=8

To do the edit of the build.prop file I had to use the following command as root:

mount -o remount,rw /system

Then edit the /system/build.prop file, then I exited adb shell session and issued a reboot to the phone. I also added some extra things that were in the original build.prop on a stock XT901, see below:

# Some of the diffs for xt901 Solstice config.
ro.cdma.home.operator.alpha=U.S. Cellular
ro.cdma.ecmexittimer=600000
ro.cdma.ecmexittimer=600000
ro.cdma.subscription=0
cdma.operator.numeric=311580
ro.cdma.home.operator.numeric=311220
ro.cdma.data_retry_config=max_retries=infinite,0,0,10000,10000,100000,10000,10000,10000,10000,140000,540000,960000

persist.radio.vrte_logic=2
persist.radio.apn_delay=5000
persist.radio.0x9e_not_callname=1

Also after a few days of tinkering with APN settings I discovered that there was a lot of differences between stock /etc/apns-conf.xml and cm11 one, so I uploaded a stock US Cellular one and that really helped when I selected preferred as:

CMDA/EvDo auto

And then dialed:

*228

Below are some extra things that might help:

http://teamuscellular.com/Forum/topic/4901-possible-fix-for-custom-roms-and-4g-data/

Hidden menu: *#*#4636#*#*
Update Roaming Towers: *228

x509 cert

19 months ago

Setup of certificate from:

https://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl

openssl req -x509 -newkey rsa:2048 -keyout rootCAKey.pem -out rootCA.pem -days xxx -nodes

go lang build notes

19 months ago

I was working on a project with go lang and these are some notes on the journey.

# Export path for your install of go
export PATH=$PATH:$HOME/scratch-go/go/bin/

# Export go root path
export GOROOT=$HOME/scratch-go/go

# Export work path for go builds
export GOPATH=$HOME/scratch-go-builds/

# Build for your taget platfrom, say a raspberry pi 2
# According to a fellow who knows more about go than I (thanks to Andy); GOARM is optional; if you leave it out, it will be optimized for older chips and not take advantage of newer features.
GOOS=linux GOARCH=arm GOARM=7 go build

Video notes

22 months ago

Convert a large video in to two smaller segments I found the below at http://superuser.com/questions/140899/ffmpeg-splitting-mp4-with-same-quality

ffmpeg -i largefile.mp4 -t 00:50:00 -c copy smallfile1.mp4 -ss 00:50:00 -c copy smallfile2.mp4

Since on Debian 8, I have adjusted from ffmpeg to avconv

avconv -i largefile.mp4 -t 00:50:00 -c copy smallfile1.mp4 -ss 00:50:00 -c copy smallfile2.mp4

And on the above I had trouble getting audio to work on second segment so I ended up doing

avconv -i largefile.mp4 -ss 00:50:00 -t 01:50:00  -target ntsc-dvd smallfile2.mpg

Note: I had need to make a mpg file just a bit smaller for a dvd I was wanting to make. I utilized the -q option and the values range from 1 (I think the default) to 31. So the following worked for me:

avconv -i largefile.mpg -q 5 -target ntsc-dvd smaller.mpg

irssi notes

23 months ago

Just as a placeholder the below line will fire off irssi on reboot:

# m h  dom mon dow   command
@reboot screen -S auto -d -m irssi

UnoBook 2/ter

2 years ago

Recently had the chance to have a go at getting Linux on the UnoBook 2/ter from CDI. It took a lot longer than I thought it would and in the end it was just a case of getting the information together. Part 1 of the install was getting a usb key that would boot UEFI correctly. To do this I followed the instructions here:

https://github.com/lopaka/instructions/blob/master/ubuntu-14.10-install-asus-x205ta.md

I used an Ubuntu 15.10 64bit image for my setup. The part from the link information which was not clear for me was that the installer fails since it can not install grub. But you boot in to the installed setup. Next I copied my existing build folder to the usb drive then I ran the following command after mounting the usb drive and cd to the build directory on the usb drive:

../grub-install -d . --efi-directory /boot/efi/ --target=i386

After that some grub cleanup tidy work was needed:

grub-install /dev/mmcblk0
update grub

After that I was able to boot. Next was the network card. There was an option to pick the network card in the bios. I choose the rtl8723bs and the next link was the magic:

https://github.com/hadess/rtl8723bs

Audio controls show but do not work. The device seems similar to the WinBook TW100 10.1 Tablet.

Hosting with single IP

2 years ago

1. Create a custom folder for each site under /var/www/html for each site.

2. If you want to enable ssl do the following on Ubuntu:

a2ensite default-ssl
a2enmod ssl

3. Configure a custom sites-enabled:

# non-ssl
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html/YOURSITE
	ServerName YOURSITE
	ServerAlias YOURSITE *.YOURSITE
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/html/YOURSITE>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/YOURSITE-error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/YOURSITE-access.log combined
</VirtualHost>

<VirtualHost *:443>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html/YOURSITE
	ServerName YOURSITE
	ServerAlias YOURSITE *.YOURSITE
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/html/YOURSITE>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/YOURSITE-error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/YOURSITE-access.log combined
	SSLEngine on
	#   A self-signed (snakeoil) certificate can be created by installing
	SSLCertificateFile	/etc/ssl/certs/ssl-cert-snakeoil.pem
	SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
</VirtualHost>

xrandr

2 years ago

I had the chance to configure dual monitors with XFCE and I did this to give me an extended desktop

xrandr --output VGA-1 --auto --output DVI-I-1 --mode 1920x1080 --pos 0x0 --auto --left-of VGA-1

Adjust Copyright

2 years ago

Update Copyright from a project folder:

for file in $(rgrep '2005-2012' * | awk -F: '{ print $1 }'); do sed -i -e 's|2005-2012|2005-2015|g' "$file"; done

OldWiki

2 years ago

Upgrading to new Tiddlywiki and retiring the old wiki. Click here to go to the retired wiki.