Posts

Showing posts with the label linux

Centos 7 pulseaudio

Image
Centos 7 doesn't come with an option for `awesome-wm` installation.  Therefore, the only way to make use of this light-weight tiling manager one has to enable Fedora 19 repo or build the package from source.  For the Fedora 19 repo approach, see: https://gist.github.com/ILMostro/1909a50e1858d0ee7e10 To use without GDM, GNOME's display manager, and without gnome services, one has to be aware of certain shortcomings that the gnome-services provide by default.  One such shortcoming is the lack of built-in Sound and Volume management.  Never fret, though, as there is a solution; namely, the PulseAudio-focused tools pavucontrol and pavumeter .  These packages are available from the " nux-desktop " repository available at at http://li.nux.ro/repos.html . nux-desktop My unofficial, as-is, not for profit RPM repositories for EL (RHEL, CentOS, ScientificLinux etc): These repos may or may not be up to date or behave the way you expect them to; use them at yo

cPanel Removal

It's a poorly-kept secret that cPanel wants to prevent Server owners and/or administrators from being able to purge their systems from the rootkit-like software.  While they've recently made a change claiming to focus on support for primarily rpm-based Linux distributions, i.e. mainly Red Hat and CentOS; cPanel software breaks almost EVERYTHING RHEL/rpm-related on the system! Their use of binary packages and perl scripts along with choosing to disable SELinux completely puts this outdated and soon-to-be obsolete software in direct conflict with anything Linux! I wish they had switched to support Windows instead. In any case, here's yet another blog post online outlining the procedure attempting to, relatively cleanly, remove cPanel from a VPS running CentOS 7 in a Virtuozzo container. yum list \*cpanel\* yum remove \*cpanel\* Remove the line in /etc/yum.conf starting with "exclude". # cat /etc/yum.conf [main] #; exclude=courier* dovecot* exim

LUKS Encryption and Unattended boot on Headless Servers

The anaconda installer on Redhat-based Linux distributions provides the user with an option to encrypt the /home partition by selecting a simple check-box. This adds an obviously valuable security/privacy feature to the system if it's selected. Consequently, this prompts the user for a password during the boot process, which then decrypts the partition and mounts it in the designated location on the filesystem. The default behaviour is not very well suited for unattended reboots or on headless servers. The crypttab(5) manual page provides great information on how to facilitate the process for unattended boots: DESCRIPTION The /etc/crypttab file describes encrypted block devices that are set up during system boot. Empty lines and lines starting with the "#" character are ignored. Each of the remaining lines describes one encrypted block device, fields on the line are delimited by white space. The first two fields are mandatory, the

LVM Snapshot Causes Boot Failure

If you've created an LVM Snapshot before rebooting your system and found yourself staring at the dracut rescue shell you might be stricken by the same problem as I was.  Executing init U on the dracut commandline resulted in a descriptive error message (that might also be found in the journal/logs) about a missing dm-snapshot kernel module.  I've attempted to troubleshoot the problem for a couple of hours, failing to add the kernel module in the end--as I wasn't able to get to a working kernel.  Ultimately, the only solution was to remove the snapshot Volume, which proved to be more difficult than expected. To remove the snapshot LV, one executes: dracut #: lvm lvremove vg_name/lv_snapshot_name However, you might be confronted by an error message there as well.  It seems that the volume is locked at that time.  To get around this, simply remove the /etc/lvm/lvm.conf file from the volatile initramfs "filesystem". dracut #: rm /etc/lvm/lvm.conf

OpenStack Installation on RHEL7 System

Image
There's a simple "Get Started" Guide on the redhat website, which briefly outlines how to get a sample OpenStack system up and running in 5 steps.  The first, easily overlooked step is to start by installing a "minimum-install" version of RHEL7 on a physical system.   If you've already set up and configured a system that you're using for everyday tasks and/or work functions, be aware that the installation will repeatedly fail with errors due to incompatible options, missing dependencies, etc.  Provided that you've followed the consequent steps in the guide to register the system and enable the pertinent repositories, the next step is to install and run the packstack script: # yum install openstack-packstack # packstack --allinone This is a rather lengthy python script that uses some puppet modules to install the necessary software components and configures the system as the OpenStack All-in-One server.  According to the packstac

bash tips

- no title specified Little-known bash commands for the SysAdmin Toolbox finger  This is a user-information lookup program, which display information on system users.  If it's executed without an argument it will display a list of currently-logged in users:     Login     Name       Tty      Idle  Login Time   Office     Office Phone   Host user1     user1     tty1     1:40  Jan  7 15:57                           (:0) user1     user1     pts/0          Jan  7 15:58                           (192.168.9.1) Given a username as an argument it will display extended information on that user: # finger user1 Login: user1                         Name: user1 Directory: /home/user1               Shell: /bin/bash On since Thu Jan  7 15:57 (CST) on tty1 from :0     1 hour 40 minutes idle On since Thu Jan  7 15:58 (CST) on pts/0 from 192.168.9.1    4 seconds idle No mail. No Plan. chfn   Similarly, use the chfn command to

Linux date Command: Day of Week

To find the day of week (e.g. Friday) on a particular date using the Linux version of the `date` utility, execute: $ date -d 'Jan 03 2004' "+%a" Sat The -d flag tells the utility to display the information only, instead of setting the date, etc. The "+%a" options are`date`'s FORMAT options, which are listed in the manpages. So, for example, we can also have the full name of the weekday output by changing the "+%a" to "+%A". $ date -d 'Jan 03 2004' "+%A" Saturday DATE(1) User Commands NAME date - print or set the system date and time SYNOPSIS date [OPTION]... [+FORMAT] ... ... FORMAT controls the output. Interpreted sequences are: %% a literal % %a locale's abbreviated weekday name (e.g., Sun) %A locale's full weekday name (e.g., Sunday) %b locale's abbreviated month name (e.g., Jan) %B

SELinux Failure after Fedora22 Upgrade

SELinux got somehow mangled during upgrade process from Fedora21 -> Fedora22. Some of the modules were changed between the versions and as a result my SELinux "system" is borked. It'd be nice to have more available documentation on re-installing and/or resetting SELinux on a system.  I can't use any of the normal tools to manage SELinux, as it only prints out errors like `libsepol.permission_copy_callback...`.  Attempting to relabel a filecontext, for example results in: # semanage fcontext -a -t system_dbusd_var_lib_t /var/lib/dbus/machine-id libsepol.context_from_record: type radicale_port_t is not defined (No such file or directory). libsepol.context_from_record: could not create context structure (Invalid argument). libsepol.port_from_record: could not create port structure for range 5232:5232 (tcp) (Invalid argument). libsepol.sepol_port_modify: could not load port range 5232 - 5232 (tcp) (Invalid argument). libsemanage.dbase_polic

SDL2 With Eclipse on Fedora22

On a Fedora22 system with Eclipse Mars version 4.5.1 this worked for me. Create a new C++ project (File > New > C++ Project).  You will need to pick a toolchain - Linux GCC. If you want to use C++11 do the following: Right click your Project under “Package Explorer” and select Properties. Select (C/C++ Build > Settings > GCC C++ Compiler > Dialect)  Under “Language standard” select: "ISO C++11 (-std=c++0x)". Click Apply, then OK. Configure Eclipse to use SDL2 At this step, I'd suggest to use the system's terminal/shell to find out or verify the existence/location of the necessary files/libraries for SDL2 on your system.  First, if you want to find the location of the necessary libraries on your system, executing the following in the terminal will provide you with the "include" location and other compiler/preprocessor flags $ sdl2-config --cflags Similarly, to list the libraries/linker-flags $ sdl2-config --libs

RHEL7 Fedora as Network Router and Gateway

Hardware Requirements: 2 Ethernet Network Cards: 1 for WAN; 1 for LAN Optional Wireless Router for wifi Software Requirements: NIC Configuration Files sysctl Kernel Parameters Firewall Configuration dhcpd Server For the sake of clarity the two network cards will be called ifcfg-wan (WAN) and ifcfg-lan (LAN); make the necessary changes for your environment accordingly, e.g. eth0, ens1, enp0s77, etc., as I will not outline how to make naming changes for hardware devices.  The configuration files for the relevant network adapters/cards are located in /etc/sysconfig/network-scripts/ifcfg-wan and /etc/sysconfig/network-scripts/ifcfg-lan files . First, make sure all the interfaces are "down" and the ethernet cables are unplugged from both adapters.  Assuming you're not using NetworkManager this can be accomplished on the commandline with "ifdown wan" and/or "ifdown lan". Next, check the system's network activity for open por

Troubleshoot USB-Printer Connected to Router

I had complained about a flood of error messages being continuously printed out every time a print job was sent to the USB-printer attached to my Asus AC56U router with merlin-378.55_beta1 . Yesterday, after I had reverted to the official asuswrt firmware to troubleshoot the printer-sharing feature, I used nmap on my laptop to see the open common ports on the clients on my network: Code: # nmap -T4 -F 192.168.1.0-2   The router displayed two ports related to the printer service: Code: 192.168.1.1 Host is up (0.0065s latency). Not shown: 94 closed ports PORT STATE SERVICE 53/tcp open domain 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds 515/tcp open printer 9100/tcp open jetdirect   Anyway, long story short, I had been using the socket://192.168.1.1:9100 path to the printer; changing the configuration on my laptop (CUPS-server) to point to lpd://192.168.1.1:515/AUTO finally resulted in SUCCESS!

Linux: Keyboard-Mapping Control

Remapping Keys Given the variations in physical keyboard layouts across personal computers from different manufacturers, the potential for a configured key to be mapped differently than expected or even to be missing on some keyboards creates the need for System Administrators to be able to remedy this problem by remapping the desired functions to the available key(s) of their choosing.  Luckily, there are a number of powerful tools available for the Linux OS, some of which will be outlined in this note with a few usage examples and scenarios. xev xmodmap showkey loadkeys How to Map the Super key to Search key The Samsung Chromebook doesn't have a Super key, or "Windows" key, on its keyboard; as a result, the Super key, which is usually mapped to it by default, is missing from the keyboard and the user is missing a useful function from certain applications.     In order to provide the user with a convenient shortcut on their keyboard, first we need to

Virtual Interfaces and VLANs in Fedora20

Setting up VLAN interfaces in Fedora20 VLAN is an acronym for Virtual Local Area Network. Several VLANs can co-exist on a single physical switch, which are configured via Linux software and not through hardware interface (you still need to configure actual hardware switch too). Hardware Device Requirements • To be able to use VLANs you will need a switch that support the IEEE 802.1q standard on an Ethernet network. • You will also need a NIC (Network Interface Card) that works with Linux and support 802.1q standard. Setting Up 802.1q VLAN Tagging This is based on Fedora documentation, specifically F17-System Administrators Guide http://docs.fedoraproject.org/en-US/Fedora/17/html/System_Administrators_Guide/s2-networkscripts-interfaces_802.1q-vlan-tagging.html . • First, ensure that the 8021q kernel module is loaded with the following command: # lsmod | grep 8021q # modprobe 8021q is the command to load it if no output results from the grep command above. • Configur

How to Connect a TI Graphing Calculator to a Linux PC

Image
This post will document how to install a linking program for a TI-83+ on a Fedora18-x86_64 laptop. The purpose of the program is to be able to connect your Graphing Calculator via a USB TI Connectivity Cable, in order to transfer data to/from your Graphing Calculator. I should mention that I am not in any way affiliated with the developers of any of these programs, and I take no credit for any of its development; this is merely meant to help those who are struggling to install this valuable software on their computers. What you will Need TI Graphing Calculator (obviously) Connectivity Cable (GraphLink cable) TILP 2 (TI Linking Program) TILIBS (the library files for the program) libglade2-dev, libusbx-devel (development files for certain libraries on your Fedora/Linux computer) Installation I will assume that you already have the calculator and the necessary cables for the remainder of this procedure, and so we will proceed to download the necessary files from ticalc.org

Raspberry Pi2 Serial-to-USB Connection on Linux

Image
      Raspi2 Serial In order to connect the raspberry pi 2 to a PC running Linux one must first obtain a "USB-to-TTL" Serial Debugging cable; certain precautions need to be made when selecting the appropriate cable: it should use 3.3V logic levels to avoid frying your board Since GPIO headers are not adjacent, it should have separated cables for each pin https://www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/README.md http://elinux.org/RPi_Serial_Connection

Samsung Printer Scanner on Linux

Once again, I've been made to feel as just another outcast in the information age of script-kiddies and spreadsheet warriors; yet another instance of a corporation neglecting Linux users with lacking software support and drivers for their devices.  As in most other cases, the linux community provides their own workaround in this instance as well; namely, the SANE (Scanner Access Now Easy) backend and libraries for the Samsung CLX-3185 Multifunction Printer/Scanner device.  The Samsung support website claims to offer a "Universal Linux Driver", but that's just a smokescreen created by the ineffective binaries and poorly constructed installation scripts from Samsung.  Notwithstanding, the SANE backend implementation isn't perfect  either--as there are still issues with certain System setups, USB 3.0, or simply non-supported devices--but it's far better integrated into the Linux ecosystem.  It can be very frustrating not being able to complete an important tas

CPU Fan Control on ThinkPad Laptop

I have a Lenovo ThinkPad laptop that occasionally displays error messages about "Hardware events/THERMAL EVENTS" during times of high CPU usage.  This is a scary set of messages in the journal logs that could prophecy a short life span of the CPU if neglected; at times I've suspected that it may have been the culprit of system crashes, though, I won't go into further details on that here. It's worth noting that the performance improves and error messages subside after one disassembles the laptop and cleans out the heat sink; maybe even properly applies a fresh coat of thermal compound on it.  This improvement, however, never lasts too long as the dust accumulates within the heatsink area again. I can recall reading anecdotal evidence of this problem from other ThinkPad owners on the Lenovo forums and other places when I first came across these scary messages on my system.  Those owners running Linux on their laptops offered explanations a