- First, your wireless printer should already be configured and online; you can check the network settings by pressing the "Go" button on the printer three times within two seconds. This will print 3 pages and one of them would have the IP address of the printer.
- Install the AUR package (https://aur.archlinux.org/packages/brother-hl2270dw/):
yaourt brother-hl2270dw
- Go to Manage Printing (CUPS Web Interface) http://localhost:631
- Use your user's login information when prompted
- Go to Administration, Add printers
- Follow the wizard, it should now list Brother HL-2270DW series as one of the "Discovered Network Printer". Select it and add this printer.
- Print a test page: From the printers menu, select "Maintenance" and then select "Print Test Page".
- From the Jobs, you can see this new print task. If if is successful, congrats else, it will show an error like "Could not find printer BRX3X0X5X1XAXAX.local ".
- Edit /etc/hosts file and add the printer IP address from the network printer settings
e.g, 10.111.112.12 BRX3X0X5X1XAXAX.local - Save the hosts file, and retry printing.
Monday, September 4, 2017
Manjaro Linux 17.0 - Arch Linux - Brother HL-2270DW Wireless Printer
Saturday, July 25, 2015
Manjaro 0.8.13 x64 and Asus USB-N13 B1
I have a Asus USB-N13 B1 and the default installation used a driver that would not give enough speed. The signal strength also stayed under 90%.
Make sure the revision is in fact B1. There's a different revision, A1 that uses a different chipset and this procedure will not work.
It's quite easy to install a proper driver for this USB wifi dongle.
I used yaourt to install 8192CU driver from AUR. I have 3.18.18.1 Linux kernel and also installed the linux headers for this. I don't think this step was necessary, since it seems the dependencies pull these when installing the driver.
The driver install may error out with this:
modprobe: ERROR: could not insert '8192cu': Device or resource busybut the driver installation actually goes through. Just restart the machine and make sure lsmod shows the 8192cu loaded. Also, the installation will create a blacklist file (blacklist-8192cu-dkms.conf ) at /etc/modprobe.d location. This will blacklist the installed rtl8192cu etc. drivers.
Ran into an issue with the next manjaro update. The update included a kernel upgrade from the original 3.18.18.1 to 3.18.20-1-MANJARO, and it broke the driver. Ideally the kernel upgrade is supposed to reconfigure all the dkms modules, but in this case it did not, and I was unable to connect to the internet.
The best thing to do after a kernel upgrade is to manually run the following command. Do this before restarting the machine, so you are not left without an internet.
$ sudo dkms autoinstallOptionally, you can specify the kernel module as well.
$ sudo dkms autoinstall -k $(uname -r)
Saturday, December 13, 2014
Amazon Instant Video on Ubuntu 14.04
Here are the commands. Note I already had flash plugin installed for ff and chrome, so I could play videos from youtube but not Amazon Instant video.
sudo add-apt-repository ppa:mjblenner/ppa-hal
sudo apt-get update
sudo apt-get install hal
Thursday, July 17, 2014
Netgear WNDR3700v2 - stuck on firmware 1.0.0.32? Need to downgrade to older firmare?
The instructions are pretty accurate, but they did not work for me.
- I used a Mac.
- Downloaded TFTP Client. It's a shareware, and it worked like a charm.
- I had a difference router ip: 10.0.0.1 and a different password than the default 'password'. I think that was the issue for the posted instructions not to work.
- I went to http://routerlogin.net/index.htm use admin and my password, then Maintenance, Backup Settings - Erase. Erase all the settings so now the router IP was 192.168.1.1 and username password: admin/password.
- I then use TFTP server: No matter what I did, it won't allow me to upload any firmware. Searching for the issue,

Finally, the upload succeeded. Now I am back to v1.0.0.12.
Monday, March 11, 2013
Notepad++ RegEx Search & Replace
Search for a hex color code (#000FF0) and remove the # sign or make it 000FF0.
Search: #(\w{6})
- () : Marks the group. Here this will be the 1st so group 1.
- \w : Any character
- {6} : Limits the count to 6 characters
Replace: $1
- The first matched group identified about.
Other serious choices would be sed on the unix shell.
Friday, August 17, 2012
Spring MVC - Convention over Configuration w/o Confusion?
Here is a simple example: URL app/contact - worked before invoking list method as the only GET method w/o any method level mapping - catch all after the controller mapping.
Beginning 3.1 it will not & throws a 404. But app/contact/list works & will invoke this GET method (IRRESPECTIVE OF THE METHOD NAME), as long it is the only catch-all GET method.
So you could even name it as fooBar and the same URL will invoke it. If however you get confident that the catch-all GET method will always be called for the GET and the URL won't matter, you are right but then the RequestToViewNameMapping goes out the window for the desired view; instead it will look for foorBar.jsp
Something to watch out for!
@Controller
@RequestMapping("contact")
public class ContactController{
@RequestMapping(method = RequestMethod.GET)
public List<contact> list() {
logger.info("default method list");
return contactService.list();
}
}
Note the mapping generated for this method:
INFO : org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/contact/*],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.ListWednesday, August 15, 2012
Spring Converter/ConversionService Example
@RequestMapping("edit") //Passing id as .. edit?id=1
public String editWithConverter(@RequestParam("id") @ModelAttribute("contact") Contact contact){
logger.info("edit with converter");
return "contact/edit";
}
WHAT WORKED
@RequestMapping("edit/{contact}") //Passing id as .. edit/1
public String editWithConverter(@PathVariable("contact") @ModelAttribute("contact") Contact contact){ // STS gave a warning for using {contact} without @PathVariable
logger.info("edit with converter");
return "contact/edit";
}
So what does this thing do
.. a link like `...edit/1` implicitly invokes the converter for String '1' to Contact of id '1' conversion, and brings this contact object to the view. No need for `@InitBinder` and since its a `Converter` registered with the `ConversionService` I can use this **anywhere I want - implicitly or explicitly**.
Converter:
public class StringToContactConverter implements Converter <String, Contact > {
private static final Logger logger = LoggerFactory
.getLogger(StringToContactConverter.class);
@Autowired
private ContactService contactService;
public void setContactService(ContactService contactService) {
this.contactService = contactService;
}
@Override
public Contact convert(String id) {
logger.info("Converting String to Contact");
Contact contact = contactService.getContact(Long.parseLong(id));
return contact;
}
}
Configuration: servlet-context.xml
<annotation-driven conversion-service="conversionService"/> <beans:bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" > <beans:property name="converters"> <beans:list> <beans:bean class="com.aj.recipes.web.convert.StringToContactConverter"> </beans:bean></beans:list> </beans:property> </beans:bean>
Thursday, May 3, 2012
Javascript Constructor & Namespacing
The following code demonstrates how to create a name space as well as constructors for JS Objects.
var a = {};
a.b = {};
a.b.C = function(){
console.log("Constructor called!!");
this.value="a.b.C";
this.toString = function(){return this.value};
}
//console.log(b) // ReferenceError: b is not defined
console.log(a.b) // Object { C=function()}
var aa = new a.b.C();
console.log("Value: " + aa.toString()); // Constructor called!!
// Value: a.b.C
Thursday, April 5, 2012
ToDo App - jQuery UI
Features Include:
- Uses jStorage for local storage: So tasks are available even after browser restart.
- Keyboard Shortcuts - q and Q to either quickly add a task or a form driven interface. Quick Add (q) follows some cryptic format but lets users "quickly" add a task. e.g., Something important ^t @Work #Feb 5 !H
- Today/Next/Someday - Tabs can be navigated using arrow keys.
- Sortable tasks - This is the jquery ui sortable; lets users drag the tasks based on the order in which they want to perform.
- Completed Tasks get nicely stricken out for that sense of accomplishment :D
- Allow drag-n-drop across panes.
- In-place editing of tasks : description/context/due/priorities
- Log of completed/deleted tasks
Friday, March 23, 2012
Unix sed - Fun at Work - Its Friday!
Input: This comes from my file.
public static final String SOME_CONSTANT_1 = "CST1"; public static final String SOME_CONSTANT_2 = "CST2";Output:
Here is the magical command.
sed -e 's/[[:space:]]\{1,\}/ /g' \
-e 's/.*g[[:space:]]\(.*\);/\1/g' \
-e 's/\(.*\)[[:space:]]*=[[:space:]]*"\(.*\)"/<option value="\2">\1<\/option>/g' \
fileName
- [1]: Replace multiple spaces/tabs [white spaces] in and around a line in a file with a single space.
- [2]: Get rid of unnecessary text
- [3]: Swap and format the output to HTML
Friday, March 16, 2012
Javascript Singleton Pattern
var QuickDialog = function(){
var privateInit = function(){console.log("init")};
return{
init: privateInit
};
}();
QuickDialog.init();
QuickDialog.privateInit();
This is the firebug output for the above code.
Javascript === vs ==
=== also looks at the type
var a = "1";
var b = 1;
console.log(a===b); //false
console.log(a==b); //true
Saturday, February 18, 2012
Spring MVC 3.1 - Cancel button
I ended up with the following solution for the time being.
Controller:
@RequestMapping(value = "cancel"
method = RequestMethod.GET)
public String cancelSaveContact() {
return "redirect:list";
}
JSP:<a href="<c:url value='/contact/cancel'/>"> <input type="button" value="Cancel"/>
Thursday, January 19, 2012
Java Lessons [3]
People have been forever zealous about jumping into new technologies, but still hanging on to obsolete ideas. Just noticed a code written for Hibernate, where HQL was formed appending several HQLs & then the parameters as well. I thought we were done with this, having identified security issues like SQL injections & the complete failure in utilizing any caching mechanism offered by Hibernate or event the database.
Use Criteria to handle these dynamic queries, at least it will be clean and secure. And Hibernate can even cache these internally, if not by the DB.
Java Lessons [2]
Wednesday, January 18, 2012
SOPA - Democracy vs Capitalism
I support artist's copyright, but don't support excessive governance. It will just be abused and it will intervene with freedom to share things. Why is internet any different from letting people borrow CD/DVD/BD books or other copy righted material offline? Isn't this another ploy to make people pay even more than they already do. I think copyrighted material should be freely available after it has lived its glory days. Something, like brand vs generic drugs. Just put a label - "Free after 1yr". Just a suggestion!
But I am certainly against excessive governance/rules, it stifles growth. Fear can never lead us in the right direction. Do we want responsible people or opportunistic thugs?
Wednesday, January 11, 2012
Subversion Notes
I discovered a nice way of managing the SVN repository where the library files need not be duplicated for every project. I started a bare bone project with the lib files and imported them into the trunk. Now any project that reuses these library files, only has to branch of this trunk and add its own files. Thus, the lib files remain just in the trunk and need not be checked in for every project that uses the files.
e.g.
ext-4.0 only exists in the trunk, a virtual copy exists in braches.
Next, I will explore svn:externals. Supposedly takes care of this shared files/project issues.
I am using svn 1.7.2 installed with cygwin/windows xp and Tortoise. Note: Apparently tortoise takes over the repository and svn command line seems to fail.
Java Lessons
Method names could be indicative of the operation but not a substitute for comments.
Tuesday, September 20, 2011
cygwin home directory setup
Here today I will briefly write about setting the home directory. As per cygwin post here I edited the /etc/passwd file to set my home directory.
At work, I have a network space alloted to me whenever I log in and I use this as the default home folder for cygwin as well. I merely edited this file for my username and changed the home directory to the network drive letter mapped in /cygdrive.. and voilla!
Thursday, April 14, 2011
AJ Computer Inventory
I am going to list some of the computers that I currently own and the different operating systems running on these.
1. Apple Powerbook PowerPC G4 1.5 Ghz (Aluminum) (Feb 2005)
- It came with Panther.
- I then tried Linux Yellow dog as a dual boot system.
- Then I installed Mac OS X Tiger.
- I then tried Ubunut 8.04, just for while.
- After more than 5 yrs finally it only runs Mac OS X Leopard.
2. iMac 24" Intel 2.4 Ghz the 1st all aluminum body launched late 2007 (Oct 2007).
- Came with Mac OS Tiger and the partial Leopard Upgrade DVD.
- I used Boot Camp and installed a custom packaged Windows XP 32 bit with SP3. (BTW this OS is 256 MB and is bootable from a CD).
- Mac OS X Leopard,
- And then the best ever upgrade - Snow Leopard 64 bit. Just awesome performance boost.
- I also have Parallels and Windows XP installed on it.
3. Custom built PC - AJ-RAID (Dec 2009)
- Intel i7 920 Quad core,
- EVGA 896-P3-1171-AR GeForce GTX 275 896MB 448-bit DDR3 PCI Express 2.0 x16 HDCP Ready SLI Supported
- OCZ Gold 6GB (3 x 2GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800)
- COOLER MASTER HAF 932 Full Tower
- CORSAIR CMPSU-750TX 750W
- I have a 1.5 TB RAID 5 configured on this machine.
I have Ubuntu 10.10 and Windows 7 Ultimate. I have tried so many linux versions on it, but now I have it down to Ubuntu 10.10. I will probably upgrade to 11.04 soon.
I tried Open Suse, Fedora Core, and went back and forth on the 32 and 64 bit versions of Ubuntu from 9.04 onwards.
I am using VMWare for Windows XP.
4. Apple Macbook Pro i7 8GB Memory upgrade (Dec 2010)
- Snow Leopard and now waiting for Mac OS X Lion
- I also have Parallels and Windows XP installed on it.
Besides, these I have a 500 GB & 1TB external HDs.

