Tutorials & Tips
Posts explaining how to do something, fix something, etc. This is where you’ll find my useful posts.
Unfortunately, given how software evolves over time, I should probably say “once useful”. If you’re digging through the archives, check the dates.
PCMan File Manager: 7z and rar archives
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
By default, pcmanfm will not extract/create 7zip and Rar archives. Extracting rar archives is already implemented but not enabled by default while the ability to extract 7z archives is not implemented at all. To enable the extraction of rar and 7zip archives and the creation of 7zip archives open src/ptk/ptk-file-archiver.c
:
Uncomment:
{
"application/x-rar",
NULL,
"unrar -o- e",
".rar", TRUE
}
And add this below:
{
"application/x-7z-compressed",
"7zr a -bd -y",
"7zr x -bd -y",
".7z", TRUE
}
Next, insert a comma, after the end bracket of the rar section.
The archive handlers section should endup looking like this:
const ArchiveHandler handlers[]=
{
{
"application/x-bzip-compressed-tar",
"tar --bzip2 -cvf",
"tar --bzip2 -xvf",
".tar.bz2", TRUE
},
{
"application/x-compressed-tar",
"tar -czvf",
"tar -xzvf",
".tar.gz", TRUE
},
{
"application/zip",
"zip -r",
"unzip",
".zip", TRUE
},
{
"application/x-tar",
"tar -cvf",
"tar -xvf",
".tar", TRUE
},
{
"application/x-rar",
NULL,
"unrar -o- e",
".rar", TRUE
},
{
"application/x-7z-compressed",
"7zr a -bd -y",
"7zr x -bd -y",
".7z", TRUE
}
};
Compile with a standard ./configure; make; make install
or ./configure; make; checkinstall
.
Install Flash Player 10 in liferea
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
Installing flash player 10 in Ubuntu does not install it for Liferea.
The fix for this is very simple:
First install Flash Player 10 using this Tutorial
Next execute this command in the terminal:
sudo ln -s /usr/lib/firefox-addons/plugins/libflashplayer.so \ /usr/lib/xulrunner-addons/plugins/libflashplayer.so
Flash Player 10 should now work in Liferea.
Tip: Purge Auto-installed packages with Aptitude
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
When switching from apt-get to aptitude, I discovered that aptitude, unlike apt-get, does not purge configuration files of auto-removed packages when given the command aptitude purge package
. The fix for
this is very simple.
In order to purge configuration files only when the purge command is given you must either specify the --purge-unused
option in the command or create an alias. To create an alias add this alias command='sudo aptitude purge --purge-unused'
to ~/.bashrc
. Command is the command that you would like to assign for purging the packages.
To always purge configuration files for auto-removed packages add Aptitude::Purge-Unused=true
to /etc/apt/apt.conf.d/05aptitude
. This will cause aptitude to always purge configuration files for all auto-removed packages regardless of weather or not the command was aptitude purge
or aptitude remove
.
Make Firefox 3's autocomplete bar work with a dark theme
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
I use MurrinaAngustifolium as my gtk theme but, because it is a dark theme, it does not always play nicely with other applications. One problem that I have finally fixed is the drop-down auto-complete menu for the location bar. Put the following code in your userChrome.css
file (or use stylish).
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.ac-comment {
font-size: 100% !important;
color: #dddddd !important;
}
.ac-comment[selected="true"] {
color: #56aaff !important;
}
.ac-url-text {
font-size: 100% !important;
color: #555555 !important;
}
.ac-url-text[selected="true"] {
color: #666666 !important;
}
.autocomplete-richlistbox {
background: #1a1a1a !important;
}
.autocomplete-richlistitem[selected="true"] {
background: #000000 !important;
}
tooltip {
background-color: #1a1a1a !important;
color: #ffffff !important;
}
This code also makes some of the tooltips black.
'Pause' command in linux
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
Windows comes with a very useful pause
command. Linux does not. This can be problematic when running programs in the terminal from the GUI. If a program runs in a terminal but did not originated in the terminal (i.e. you double click on a file in nautilus and select run in terminal) the terminal window closes immediately when the program finishes. This makes it impossible to read the output from the terminal.
This function can be added to your ~/.bashrc
file:
function pause() {
test $* read -p "$*" || read -p "Press enter to continue..."
}
I found this code on www.cyberciti.biz but edited it to allow for no arguments.
HOWTO: Create a floating sidebar on the left (Minima)
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
It took me a while to get the floating sidebar on the left of this page working well so I decided to write this post in order to save others time and frustration. I made this tutorial for the Minima template but you could modify it in order to work with any template.
Add this:
/* Floating sidebar on left */
#fixedsidebar-wrapper {
position: fixed;
top: 75px;
left: 10px;
width: 100px;
float: left;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}
#big-wrapper {
margin: 0 150px 0 100px;
}
Below this:
#sidebar-wrapper {
width: 220px;
float: $endSide;
word-wrap: break-word; /* fix for long text breaking sidebar float in IE */
overflow: hidden; /* fix for long non-text content breaking IE sidebar float */
}
Then, to fix the page elements tab…
Add this:
/** Page structure tweaks for layout editor wireframe for floating sidebar on left **/
body#layout #outer-wrapper,
body#layout #header-wrapper,
body#layout #footer {
width: 500px;
padding: 0px;
}
body#layout #main-wrapper {
width: 300px;
}
body#layout #sidebar-wrapper {
width: 200px;
}
body#layout #newsidebar-wrapper {
width: 150px;
}
…below the previous code.
To remove the dotted line under widgets…
Add this:
#fixedsidebar.sidebar .widget {
border-bottom-width: 0 !important;
}
Below this:
.sidebar .widget, .main .widget {
border-bottom:1px dotted $bordercolor;
margin:0 0 1.5em;
padding:0 0 1.5em;
}
Then add <div id="big-wrapper">
just under <body>
. This will make
sure that the floating sidebar will not overlap the other content.
Now in order to actually place the sidebar…
Add this:
<div id="fixedsidebar-wrapper">
<b:section class="sidebar" id="fixedsidebar" preferred="yes">
<b:widget id="NewProfile" locked="false" title="'About" type="Profile" />
</b:widget>
</b:section>
</div>
Below this:
<div id="content-wrapper">
<div id="crosscol-wrapper" style="">
<b:section class="crosscol" id="crosscol" showaddelement="no" />
</b:section>
</div>
Finally, add a </div>
tag before the </body>
tag to close the “big-wrapper”
This post is heavily based on this tutorial but creates a fixed (floating) sidebar instead of a sidebar that scrolls with the rest of the page.
Turn on keyboard led when receiving mail
Caveat lector: I wrote this post in high school; it’s likely outdated and poorly written.
After a lot of fruitless searching I finally figured out the command to turn the scroll lock led on and off in X. I first tried setleds +scroll
and setleds -scroll
but that only works in a Virtual Terminal. I then tried xset led on
and xset led off
. That one messes up the num pad. I finally came up with the following:
On:
xset led 3
Off:
xset -led 3
I use mail-notification and set the scroll lock led to go on when I have new mail and set it to go off when I have read the mail.